pub struct EmailService;
Expand description
Service for handling email-related operations.
Implementations§
Source§impl EmailService
impl EmailService
Sourcepub async fn send_password_reset_email(
to_email: &str,
reset_token: &str,
) -> Result<(), Box<dyn Error>>
pub async fn send_password_reset_email( to_email: &str, reset_token: &str, ) -> Result<(), Box<dyn Error>>
Sends a password reset email to the specified email address.
§Arguments
to_email
- The recipient’s email addressreset_token
- The password reset token to include in the reset link
§Returns
Result<(), Box<dyn std::error::Error>>
- Ok(()) if email was sent successfully, Err containing the error if sending failed
§Email Content
The email includes both plain text and HTML versions with:
- A personalized greeting
- A reset password link
- Expiration notice (15 minutes)
- Security warning for unintended recipients
- Styled HTML version with a clickable button
Sourcepub async fn send_password_changed_email(
to_email: &str,
) -> Result<(), Box<dyn Error>>
pub async fn send_password_changed_email( to_email: &str, ) -> Result<(), Box<dyn Error>>
Sends a password change confirmation email to the specified email address.
§Arguments
to_email
- The recipient’s email address
§Returns
Result<(), Box<dyn std::error::Error>>
- Ok(()) if email was sent successfully, Err containing the error if sending failed
§Email Content
The email includes both plain text and HTML versions with:
- Confirmation of password change
- Security warning for unintended changes
- Simple HTML formatting
Auto Trait Implementations§
impl Freeze for EmailService
impl RefUnwindSafe for EmailService
impl Send for EmailService
impl Sync for EmailService
impl Unpin for EmailService
impl UnwindSafe for EmailService
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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