Trait EmailProvider

Source
pub trait EmailProvider: Send + Sync {
    // Required methods
    fn send<'life0, 'life1, 'async_trait>(
        &'life0 self,
        email: &'life1 Email,
    ) -> Pin<Box<dyn Future<Output = Result<EmailResult, EmailError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn validate_config<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), EmailError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn provider_name(&self) -> &'static str;
}
Expand description

Email provider abstraction

Required Methods§

Source

fn send<'life0, 'life1, 'async_trait>( &'life0 self, email: &'life1 Email, ) -> Pin<Box<dyn Future<Output = Result<EmailResult, EmailError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send an email immediately

Source

fn validate_config<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), EmailError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Validate configuration

Source

fn provider_name(&self) -> &'static str

Get provider name

Implementors§