Skip to main content

EmailSender

Trait EmailSender 

Source
pub trait EmailSender:
    Send
    + Sync
    + 'static {
    // Required method
    fn send<'a>(
        &'a self,
        email: &'a Email,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'a>>;
}
Expand description

Trait for sending emails from handler contexts.

Implemented by the runtime for SMTP and HTTP-based providers (Resend, SES). Mocked in test contexts.

Required Methods§

Source

fn send<'a>( &'a self, email: &'a Email, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'a>>

Send an email. Returns the provider’s message ID on success.

Implementors§