ORIONIS API REFERENCE

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 documentation

class MailManager(PendingMail, IMailManager): (source)

Constructor: MailManager(app, composer)

View In Hierarchy

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 _applyGlobalSender Overlay the configured global sender on an envelope that declares none.
Async Method _buildMailable Build one reusable mail declaration with the application container.
Async Method _deliver Prepare a message completely before resolving and invoking its transport.
Method _resolveMailer Normalize only the selected central mailer without environment reads.
Method extend Register a new driver without silently replacing existing registrations.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable _app Central configuration and dependency container.
Instance Variable _composer Single pipeline for views, storage, validation, and MIME.
Instance Variable _factories Factories registered to construct the available transport backends.
def __init__(self, app: IApplication, composer: MailComposer): (source)

Retain shared dependencies without validating or opening transports.

Parameters
app:orionis.IApplicationCentral configuration and dependency container.
composer:orionis.mail.composer.MailComposerSingle pipeline for views, storage, validation, and MIME.
Returns
NoneInitialize an empty fluent chain and defer built-in factories.
def _applyGlobalSender(self, envelope: Envelope) -> Envelope: (source)

Overlay the configured global sender on an envelope that declares none.

Parameters
envelope:orionis.mail.entities.EnvelopeOperation-local envelope without a From header.
Returns
orionis.mail.entities.EnvelopeThe received envelope when no global sender is configured, or an equivalent copy carrying the configured mailbox.
Raises
orionis.mail.exceptions.MailConfigurationExceptionIf the configured sender is neither a mapping nor an entity.
orionis.mail.exceptions.MailCompositionExceptionIf the configured mailbox or display name is invalid.
async def _buildMailable(self, mailable: type[Mailable]) -> Mailable: (source)

Build one reusable mail declaration with the application container.

Parameters
mailable:type[orionis.mail.Mailable]Reusable mail class requested by a send operation.
Returns
orionis.mail.MailableA fresh declaration with constructor dependencies injected.
async def _deliver(self, name: str | None, envelope: Envelope, content: Content, attachments: tuple[Attachment, ...]) -> MailResult: (source)

Prepare a message completely before resolving and invoking its transport.

Parameters
name:str | NoneExplicit mailer name, or None for the central default.
envelope:orionis.mail.entities.EnvelopeFinal operation-local envelope.
content:orionis.mail.entities.ContentNormalized content declaration.
attachments:tuple[orionis.mail.entities.Attachment, ...]Merged deferred attachments.
Returns
orionis.mail.entities.MailResultResult reported by the selected transport.
Raises
orionis.mail.exceptions.MailConfigurationExceptionIf the mailer, driver, or factory result is invalid.
orionis.mail.exceptions.MailExceptionIf composition, rendering, attachment resolution, or transport fails.
def _resolveMailer(self, name: str | None) -> tuple[str, str, Mapping[str, object]]: (source)

Normalize only the selected central mailer without environment reads.

Parameters
name:str | NoneExplicit mailer, or None for the central default.
Returns
tuple[str, str, collections.abc.Mapping[str, object]]Mailer name, driver name, and copied read-only configuration.
Raises
orionis.mail.exceptions.MailConfigurationExceptionIf the section, name, or selected entry is invalid or missing.
def extend(self, driver: str, factory: TransportFactory): (source)

Register a new driver without silently replacing existing registrations.

Parameters
driver:strUnique implementation name used in a mailer's driver option.
factory:orionis.mail.types.TransportFactoryCallable receiving the application and the normalized configuration and returning an IMailTransport or an awaitable of one.
Returns
NoneStore the factory without running it or validating mailer entries.
Raises
orionis.mail.exceptions.MailConfigurationExceptionIf registration is invalid or duplicates a built-in or custom driver.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

Central configuration and dependency container.

_composer = (source)

Single pipeline for views, storage, validation, and MIME.

Factories registered to construct the available transport backends.