Skip to main content

Crate modo_email

Crate modo_email 

Source
Expand description

Transactional email for the modo framework.

modo-email provides Markdown-based email templates, responsive HTML rendering, plain-text fallback generation, and pluggable delivery transports (SMTP and Resend).

§Quick Start

use modo_email::{mailer, EmailConfig, SendEmail};

let config = EmailConfig::default(); // load from YAML in practice
let m = mailer(&config)?;

m.send(
    &SendEmail::new("welcome", "user@example.com")
        .var("name", "Alice"),
).await?;

Re-exports§

pub use template::EmailTemplate;
pub use template::TemplateProvider;
pub use transport::MailTransport;
pub use transport::MailTransportDyn;
pub use transport::MailTransportSend;
pub use template::CachedTemplateProvider;
pub use template::filesystem::FilesystemProvider;
pub use template::layout::LayoutEngine;

Modules§

template
transport

Structs§

EmailConfig
Top-level email configuration loaded from YAML or environment.
MailMessage
A fully-rendered email ready for transport.
Mailer
High-level email service that ties together template loading, variable substitution, Markdown rendering, layout wrapping, and transport delivery.
SendEmail
Builder for requesting a templated email send.
SendEmailPayload
Serializable mirror of SendEmail for async job queue payloads.
SenderProfile
Sender identity for outgoing emails.
SmtpConfig
SMTP connection settings. Requires the smtp feature.

Enums§

SmtpSecurity
TLS mode for SMTP connections.
TransportBackend
Which delivery backend to use for outgoing email.

Functions§

mailer
Create a Mailer using FilesystemProvider and the transport configured in config.
mailer_with
Create a Mailer with a custom TemplateProvider.