pub struct SendEmail {
pub template: String,
pub to: Vec<String>,
pub cc: Vec<String>,
pub bcc: Vec<String>,
pub locale: Option<String>,
pub vars: HashMap<String, String>,
pub sender: Option<SenderProfile>,
}Expand description
Builder for composing an email to send.
Created with SendEmail::new and configured via builder-style methods.
Pass the completed value to Mailer::send.
Fields§
§template: StringTemplate name to render (without locale prefix or .md extension).
to: Vec<String>Primary recipients (To header).
cc: Vec<String>Carbon-copy recipients (Cc header).
bcc: Vec<String>Blind carbon-copy recipients (Bcc header).
locale: Option<String>Optional locale override. Falls back to EmailConfig::default_locale.
vars: HashMap<String, String>Variables substituted into {{var_name}} placeholders in the template.
sender: Option<SenderProfile>Optional sender override. Falls back to EmailConfig defaults.
Implementations§
Source§impl SendEmail
impl SendEmail
Sourcepub fn locale(self, locale: impl Into<String>) -> Self
pub fn locale(self, locale: impl Into<String>) -> Self
Override the locale used to load this template.
Sourcepub fn var(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn var(self, key: impl Into<String>, value: impl Into<String>) -> Self
Insert or overwrite a template variable.
The value is substituted for every {{key}} occurrence in both
frontmatter and body.
Sourcepub fn sender(self, profile: SenderProfile) -> Self
pub fn sender(self, profile: SenderProfile) -> Self
Override the sender profile for this email.
Auto Trait Implementations§
impl Freeze for SendEmail
impl RefUnwindSafe for SendEmail
impl Send for SendEmail
impl Sync for SendEmail
impl Unpin for SendEmail
impl UnsafeUnpin for SendEmail
impl UnwindSafe for SendEmail
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