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§
Structs§
- Email
Config - Top-level email configuration loaded from YAML or environment.
- Mail
Message - 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.
- Send
Email - Builder for requesting a templated email send.
- Send
Email Payload - Serializable mirror of
SendEmailfor async job queue payloads. - Sender
Profile - Sender identity for outgoing emails.
- Smtp
Config - SMTP connection settings. Requires the
smtpfeature.
Enums§
- Smtp
Security - TLS mode for SMTP connections.
- Transport
Backend - Which delivery backend to use for outgoing email.
Functions§
- mailer
- Create a
MailerusingFilesystemProviderand the transport configured inconfig. - mailer_
with - Create a
Mailerwith a customTemplateProvider.