Expand description
Puerto’s mail runtime (ADR-0020): what every generated mail shares. A project declares one
port per mail in its domain (EnviadorCorreoBienvenida); the implementation renders that mail’s
Plantillas and hands the puerto_nucleo::correo::Correo to a EnviadorCorreoSmtp. A worker consumer
sends it through enviar_una_vez(), so a redelivered event does not send it twice.
Re-exports§
pub use config::ConfigCorreo;pub use config::ErrorConfigCorreo;pub use enviar_una_vez::enviar_una_vez;pub use plantillas::Plantillas;pub use smtp::EnviadorCorreoSmtp;
Modules§
- config
- The mail configuration, read once at startup from the environment (and
.env). - enviar_
una_ vez - The step a worker consumer sends a mail through (ADR-0020 § 4): at-least-once delivery in, one mail out — or, if the process dies between the send and the mark, two. Never none.
- plantillas
- A mail’s templates:
subject.txt,body.htmland the optionalbody.txt, embedded by the generated code withinclude_str!and rendered with minijinja. - smtp
- The SMTP adapter of
EnviadorCorreo:lettreover tokio and rustls, with pooled connections.
Structs§
- Correo
- One message, rendered: who it goes to and what it says. The sender is the
EnviadorCorreo’s.
Enums§
- Error
Correo - Why a message was not sent, as far as a caller needs to know: whether trying again can help.
Traits§
- Correos
Enviados - Which mails went out for which event: what keeps an at-least-once delivery from sending the same mail twice. Keyed by the event’s id and the mail’s name.
- Enviador
Correo - Sends a rendered message.
puerto_correo::EnviadorCorreoSmtpin a project, a recording fake in tests.