pub struct Mailer { /* private fields */ }Expand description
Helps sending mails to users
Implementations§
Source§impl Mailer
impl Mailer
Sourcepub fn new(
templates: Templates,
transport: MailTransport,
from: Mailbox,
reply_to: Mailbox,
) -> Self
pub fn new( templates: Templates, transport: MailTransport, from: Mailbox, reply_to: Mailbox, ) -> Self
Constructs a new Mailer
Sourcepub async fn send_verification_email(
&self,
to: Mailbox,
context: &WithLanguage<EmailVerificationContext>,
) -> Result<(), Error>
pub async fn send_verification_email( &self, to: Mailbox, context: &WithLanguage<EmailVerificationContext>, ) -> Result<(), Error>
Send the verification email to a user
§Errors
Will return Err if the email failed rendering or failed sending
Sourcepub async fn send_recovery_email(
&self,
to: Mailbox,
context: &WithLanguage<EmailRecoveryContext>,
) -> Result<(), Error>
pub async fn send_recovery_email( &self, to: Mailbox, context: &WithLanguage<EmailRecoveryContext>, ) -> Result<(), Error>
Send the recovery email to a user
§Errors
Will return Err if the email failed rendering or failed sending
Sourcepub async fn test_connection(&self) -> Result<(), Error>
pub async fn test_connection(&self) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mailer
impl !RefUnwindSafe for Mailer
impl Send for Mailer
impl Sync for Mailer
impl Unpin for Mailer
impl !UnwindSafe for Mailer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more