Expand description
Shared mail infrastructure helpers for Aster services.
This crate intentionally does not own product templates, recipients, audit records, user context, SMTP configuration keys, or database entities. It only provides small mechanics that recur around mail outbox dispatch: dispatch counters, retry delay selection, error truncation, and best-effort retry when persisting a successful SMTP delivery. It also provides a product-neutral template registry and placeholder rendering helpers for services that own their own template codes and payloads.
Re-exports§
pub use config::DEFAULT_MAIL_SECURITY;pub use config::DEFAULT_MAIL_SMTP_PORT;pub use config::MAIL_TEMPLATE_MAX_BODY_LEN;pub use config::MAIL_TEMPLATE_MAX_SUBJECT_LEN;pub use config::MailConfigError;pub use config::MailConfigResult;pub use config::MailRuntimeSettings;pub use config::normalize_mail_address_config_value;pub use config::normalize_mail_name_config_value;pub use config::normalize_mail_security_config_value;pub use config::normalize_mail_template_body_config_value;pub use config::normalize_mail_template_subject_config_value;pub use config::normalize_smtp_host_config_value;pub use config::normalize_smtp_port_config_value;pub use config::parse_smtp_port;pub use message::MailMessage;pub use message::MailRecipient;pub use outbox::DEFAULT_ERROR_MAX_LEN;pub use outbox::DEFAULT_MARK_SENT_RETRY_DELAYS_MS;pub use outbox::DispatchStats;pub use outbox::MailOutboxDeliveryFailureDecision;pub use outbox::MailOutboxDispatchConfig;pub use outbox::MailOutboxDispatchContext;pub use outbox::MailOutboxDispatchRow;pub use outbox::MailOutboxRetryPolicy;pub use outbox::MailOutboxStatus;pub use outbox::MailTemplateCode;pub use outbox::StoredMailPayload;pub use outbox::dispatch_mail_outbox;pub use outbox::drain_mail_outbox;pub use outbox::retry_mark_sent;pub use outbox::truncate_error;pub use sender::DEFAULT_SMTP_SEND_TIMEOUT_SECS;pub use sender::MailDeliveryError;pub use sender::MailSendResult;pub use sender::MailSender;pub use sender::MemoryMailSender;pub use sender::SmtpMailSender;pub use sender::memory_sender;pub use sender::memory_sender_ref;pub use sender::send_rendered_with;pub use sender::smtp_sender;pub use template::MailTemplateCatalog;pub use template::MailTemplateCatalogBuilder;pub use template::MailTemplateDefinition;pub use template::MailTemplateRegistrar;pub use template::MailTemplateRegistry;pub use template::MailTemplateRegistryError;pub use template::RenderedMail;pub use template::TemplatePlaceholderSet;pub use template::TemplateVariableGroup;pub use template::TemplateVariableItem;pub use template::TemplateVariableSpec;pub use template::escape_html;pub use template::html_to_text;pub use template::render_placeholders;pub use template::render_template;
Modules§
- config
- Product-neutral mail runtime configuration normalization.
- message
- Product-neutral mail message models.
- outbox
- Product-neutral mail outbox dispatch helpers.
- sender
- Product-neutral mail sender implementations.
- template
- Product-neutral mail template registration and rendering helpers.
Constants§
- MAIL_
OUTBOX_ COMPONENT - Stable component name used for mail outbox lifecycle handling.
- MAIL_
OUTBOX_ DRAIN_ SHUTDOWN_ PHASE - Stable shutdown phase name for mail outbox draining.
Functions§
- mail_
outbox_ component - Creates the mail outbox runtime component used by product entrypoints.