#[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 inline_css: bool,
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
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.
inline_css: boolWhen true, rendered HTML is passed through a CSS inliner that
resolves rules from <style> blocks into per-element style=""
attributes. <style> is retained so @media rules (dark mode,
mobile) still apply on clients that honour them. Default: true.
smtp: SmtpConfigSMTP connection settings.
Trait Implementations§
Source§impl Clone for EmailConfig
impl Clone for EmailConfig
Source§fn clone(&self) -> EmailConfig
fn clone(&self) -> EmailConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more