THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class PendingMail: (source)
Constructor: PendingMail(delivery, options, mailable_builder)
Build independent chains; every fluent call returns a new operation.
A chain never builds a Mailable, renders, reads attachments, or resolves a transport: those steps belong to the asynchronous terminals. Deriving a chain copies its immutable options, so concurrent branches never share recipients.
| Method | __init__ |
Bind an immutable declaration to the manager's delivery pipeline. |
| Method | _derive |
Detach a configurator's current snapshot into a new chain. |
| Async Method | _send |
Invoke one callback, freeze its declaration, and deliver. |
| Async Method | _send |
Merge reusable declarations with explicit fluent options. |
| Method | attach |
Append a deferred storage attachment on an independent chain. |
| Method | bcc |
Append hidden recipients on an independent chain. |
| Method | cc |
Append carbon-copy recipients on an independent chain. |
| Method | from |
Replace the sender on a new independent chain. |
| Async Method | html |
Send literal HTML through the shared preparation pipeline. |
| Method | mailer |
Select a mailer on an independent derived chain. |
| Async Method | raw |
Send literal plain text through the shared preparation pipeline. |
| Method | reply |
Append Reply-To mailboxes on an independent chain. |
| Async Method | send |
Send a reusable Mailable, an HTML view, or explicit Content. |
| Method | subject |
Replace the subject on an independent chain. |
| Method | to |
Append visible recipients on an independent chain. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _delivery |
Shared preparation and transport entry point. |
| Instance Variable | _mailable |
Optional application-container resolver for Mailable classes. |
| Instance Variable | _options |
Immutable explicit options for this chain. |
Delivery, options: MailOptions | None = None, mailable_builder: Callable[ [ type[ Mailable]], Awaitable[ Mailable]] | None = None):
(source)
¶
Bind an immutable declaration to the manager's delivery pipeline.
| Parameters | |
delivery:orionis.mail.types.Delivery | Shared preparation and transport entry point. |
options:orionis.mail.entities.MailOptions | None | Immutable explicit options for this chain. |
mailableCallable[ | Optional application-container resolver for Mailable classes. |
| Returns | |
None | Initialize a chain without performing I/O. |
Detach a configurator's current snapshot into a new chain.
| Parameters | |
message:orionis.mail.Message | Temporary synchronous configurator. |
| Returns | |
orionis.mail.PendingMail | Independent operation with no render or transport side effects. |
Invoke one callback, freeze its declaration, and deliver.
| Parameters | |
content:orionis.mail.entities.Content | Already validated content declaration. |
callback:object | Configurator invoked exactly once and awaited when needed. |
| Returns | |
orionis.mail.entities.MailResult | Shared delivery outcome. |
| Raises | |
orionis.mail.exceptions.MailCompositionException | If a callback fails or returns anything other than None or itself. |
Merge reusable declarations with explicit fluent options.
| Parameters | |
mailable:orionis.mail.Mailable | Reusable synchronous declaration, never modified by sending. |
| Returns | |
orionis.mail.entities.MailResult | Shared delivery outcome. |
| Raises | |
orionis.mail.exceptions.MailCompositionException | If declaration methods fail or do not return their contracted types. |
Append a deferred storage attachment on an independent chain.
| Parameters | |
attachment:orionis.mail.entities.Attachment | Storage attachment declaration. |
| Returns | |
orionis.mail.PendingMail | Derived operation retaining previous attachments. |
Append hidden recipients on an independent chain.
| Parameters | |
addresses:orionis.mail.types.Recipients | One mailbox or a list/tuple of mailboxes. |
name:str | None | Optional name for a single string mailbox only. |
| Returns | |
orionis.mail.PendingMail | Derived operation retaining previous recipients. |
Append carbon-copy recipients on an independent chain.
| Parameters | |
addresses:orionis.mail.types.Recipients | One mailbox or a list/tuple of mailboxes. |
name:str | None | Optional name for a single string mailbox only. |
| Returns | |
orionis.mail.PendingMail | Derived operation retaining previous recipients. |
Replace the sender on a new independent chain.
| Parameters | |
address:str | orionis.mail.entities.Address | Exactly one sender mailbox. |
name:str | None | Optional name for a string mailbox only. |
| Returns | |
orionis.mail.PendingMail | Derived operation with an explicit From and transport sender. |
Send literal HTML through the shared preparation pipeline.
| Parameters | |
html:str | Literal HTML, never rendered as a template. |
callback:orionis.mail.types.MessageCallback | None | Optional sync or async operation-local configurator. |
| Returns | |
orionis.mail.entities.MailResult | Transport outcome. |
| Raises | |
orionis.mail.exceptions.MailCompositionException | If the body, callback, or resulting envelope is invalid. |
orionis.mail.exceptions.MailException | If preparation or transport fails. |
Select a mailer on an independent derived chain.
| Parameters | |
name:str | Central configuration name, not a driver name. |
| Returns | |
orionis.mail.PendingMail | A new operation; resolution remains deferred until sending. |
| Raises | |
orionis.mail.exceptions.MailConfigurationException | If the name is not a non-empty string. |
Send literal plain text through the shared preparation pipeline.
| Parameters | |
text:str | Literal text, never rendered as a template. |
callback:orionis.mail.types.MessageCallback | None | Optional sync or async operation-local configurator. |
| Returns | |
orionis.mail.entities.MailResult | Transport outcome. |
| Raises | |
orionis.mail.exceptions.MailCompositionException | If the body, callback, or resulting envelope is invalid. |
orionis.mail.exceptions.MailException | If preparation or transport fails. |
Append Reply-To mailboxes on an independent chain.
| Parameters | |
addresses:orionis.mail.types.Recipients | One mailbox or a list/tuple of mailboxes. |
name:str | None | Optional name for a single string mailbox only. |
| Returns | |
orionis.mail.PendingMail | Derived operation retaining previous reply destinations. |
Content, /, *, callback: MessageCallback | None = None) -> MailResult:Send a reusable Mailable, an HTML view, or explicit Content.
| Parameters | |
value:Mailable | type[Mailable] | str | Content | Declaration, resolvable Mailable class, or HTML view identifier. |
data:collections.abc.Mapping[str, object] | None | View context, accepted only when value is a string. |
callback:orionis.mail.types.MessageCallback | None | Operation-local configurator, not accepted for a Mailable. |
| Returns | |
orionis.mail.entities.MailResult | Confirmed SMTP acceptance or file publication result. |
| Raises | |
orionis.mail.exceptions.MailCompositionException | If arguments, container resolution, declarations, callbacks, or content are invalid. |
orionis.mail.exceptions.MailException | If preparation or transport fails. |
Replace the subject on an independent chain.
| Parameters | |
value:str | Literal subject, possibly empty. |
| Returns | |
orionis.mail.PendingMail | Derived operation with an explicit subject. |
Append visible recipients on an independent chain.
| Parameters | |
addresses:orionis.mail.types.Recipients | One mailbox or a list/tuple of mailboxes. |
name:str | None | Optional name for a single string mailbox only. |
| Returns | |
orionis.mail.PendingMail | Derived operation retaining previous recipients. |