pub struct Mail {
pub to: String,
pub subject: String,
pub text_body: String,
pub html_body: Option<String>,
pub headers: Vec<(String, String)>,
}Expand description
One outbound message. Plaintext body is required; HTML is optional. Extra headers are project-controlled.
Fields§
§to: String§subject: String§text_body: String§html_body: Option<String>§headers: Vec<(String, String)>Implementations§
Source§impl Mail
impl Mail
Sourcepub fn framework_envelope(
to: impl Into<String>,
subject: impl Into<String>,
body: impl Into<String>,
system_name: &str,
request_ip: Option<&str>,
ua_summary: Option<&str>,
when: DateTime<Utc>,
) -> Self
pub fn framework_envelope( to: impl Into<String>, subject: impl Into<String>, body: impl Into<String>, system_name: &str, request_ip: Option<&str>, ua_summary: Option<&str>, when: DateTime<Utc>, ) -> Self
Build a message with the framework’s canonical security envelope appended to the plaintext body. Used by recovery flows so every framework-emitted email carries the same “where, when, what, who” context — anti-phishing parity.
system_name should be the project’s SiteBranding::site_header
(the human label of the install); request_ip and ua_summary
are best-effort context lifted from the triggering request.
Sourcepub fn with_html(self, html: impl Into<String>) -> Self
pub fn with_html(self, html: impl Into<String>) -> Self
Builder: attach a rendered HTML body alongside the existing
plaintext. The mailer transport sends both as a
multipart/alternative MIME tree; clients pick whichever
part they prefer. Plaintext stays the source of truth — the
HTML is a polished alternative, not a replacement.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mail
impl RefUnwindSafe for Mail
impl Send for Mail
impl Sync for Mail
impl Unpin for Mail
impl UnsafeUnpin for Mail
impl UnwindSafe for Mail
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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