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 MailManager(PendingMail, IMailManager): (source)
Constructor: MailManager(app, composer)
Resolve central mail configuration and delegate the shared fluent pipeline.
The inherited empty chain is never mutated: every fluent entry creates a new PendingMail. No operation envelope, body, or attachment is cached on the manager, and factories run per send so they may resolve shared stateless transports through the container. A Mailable class is also built through the application container for each send.
Concurrency
Driver registration is synchronous and rejects duplicates, so drivers must be registered during provider startup, before concurrent sends. Transport resolution and preparation keep all per-operation state in local variables.
| Method | __init__ |
Retain shared dependencies without validating or opening transports. |
| Method | _apply |
Overlay the configured global sender on an envelope that declares none. |
| Async Method | _build |
Build one reusable mail declaration with the application container. |
| Async Method | _deliver |
Prepare a message completely before resolving and invoking its transport. |
| Method | _resolve |
Normalize only the selected central mailer without environment reads. |
| Method | extend |
Register a new driver without silently replacing existing registrations. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _app |
Undocumented |
| Instance Variable | _composer |
Undocumented |
| Instance Variable | _factories |
Undocumented |
Retain shared dependencies without validating or opening transports.
| Parameters | |
app:IApplication | Central configuration and dependency container. |
composer:MailComposer | Single pipeline for views, storage, validation, and MIME. |
| Returns | |
None | Initialize built-in factories and an empty immutable fluent chain. |
Overlay the configured global sender on an envelope that declares none.
| Parameters | |
envelope:Envelope | Operation-local envelope without a From header. |
| Returns | |
Envelope | The received envelope when no global sender is configured, or an equivalent copy carrying the configured mailbox. |
| Raises | |
MailConfigurationException | If the configured sender is neither a mapping nor an entity. |
MailCompositionException | If the configured mailbox or display name is invalid. |
str | None, envelope: Envelope, content: Content, attachments: tuple[ Attachment, ...]) -> MailResult:
(source)
¶
Prepare a message completely before resolving and invoking its transport.
| Parameters | |
name:str | None | Explicit mailer name, or None for the central default. |
envelope:Envelope | Final operation-local envelope. |
content:Content | Normalized content declaration. |
attachments:tuple[Attachment, ...] | Merged deferred attachments. |
| Returns | |
MailResult | Result reported by the selected transport. |
| Raises | |
MailConfigurationException | If the mailer, driver, or factory result is invalid. |
MailException | If composition, rendering, attachment resolution, or transport fails. |
Normalize only the selected central mailer without environment reads.
| Parameters | |
name:str | None | Explicit mailer, or None for the central default. |
| Returns | |
tuple[str, str, Mapping[str, object]] | Mailer name, driver name, and copied read-only configuration. |
| Raises | |
MailConfigurationException | If the section, name, or selected entry is invalid or missing. |
Register a new driver without silently replacing existing registrations.
| Parameters | |
driver:str | Unique implementation name used in a mailer's driver option. |
factory:TransportFactory | Callable receiving the application and the normalized configuration and returning an IMailTransport or an awaitable of one. |
| Returns | |
None | Store the factory without running it or validating mailer entries. |
| Raises | |
MailConfigurationException | If registration is invalid or duplicates a built-in or custom driver. |