#[non_exhaustive]pub struct EmailConfig {
pub templates_path: String,
pub layouts_path: String,
pub default_from_name: String,
pub default_from_email: String,
pub default_reply_to: Option<String>,
pub default_locale: String,
pub cache_templates: bool,
pub template_cache_size: usize,
pub smtp: SmtpConfig,
}Expand description
Top-level email configuration.
Deserializes from YAML. All fields have sensible defaults, so only the fields that differ from defaults need to be specified.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.templates_path: StringDirectory containing email templates (locale sub-directories allowed).
Default: "emails".
layouts_path: StringDirectory containing custom HTML layout files.
Default: "emails/layouts".
default_from_name: StringDisplay name used in the From header when no SenderProfile is set.
default_from_email: StringEmail address used in the From header when no SenderProfile is set.
default_reply_to: Option<String>Optional default Reply-To address.
default_locale: StringBCP 47 locale used when a SendEmail carries no explicit locale.
Default: "en".
cache_templates: boolWhen true, templates are stored in an in-process LRU cache after the
first load. Default: true.
template_cache_size: usizeMaximum number of entries in the template LRU cache. Default: 100.
smtp: SmtpConfigSMTP connection settings.
Trait Implementations§
Source§impl Clone for EmailConfig
impl Clone for EmailConfig
Source§fn clone(&self) -> EmailConfig
fn clone(&self) -> EmailConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmailConfig
impl Debug for EmailConfig
Source§impl Default for EmailConfig
impl Default for EmailConfig
Source§impl<'de> Deserialize<'de> for EmailConfigwhere
EmailConfig: Default,
impl<'de> Deserialize<'de> for EmailConfigwhere
EmailConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EmailConfig
impl RefUnwindSafe for EmailConfig
impl Send for EmailConfig
impl Sync for EmailConfig
impl Unpin for EmailConfig
impl UnsafeUnpin for EmailConfig
impl UnwindSafe for EmailConfig
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