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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn provider_name(&self) -> &'static str
fn provider_name(&self) -> &'static str
Get provider name