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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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