pub struct EmailConfig {
pub transport: TransportBackend,
pub templates_path: String,
pub default_from_name: String,
pub default_from_email: String,
pub default_reply_to: Option<String>,
pub cache_templates: bool,
pub template_cache_size: usize,
pub smtp: SmtpConfig,
}Expand description
Top-level email configuration loaded from YAML or environment.
All fields implement Default, so partial YAML is valid — only override
what differs from the defaults.
Feature-gated fields (smtp, resend) are only present when the
corresponding Cargo feature is enabled.
Fields§
§transport: TransportBackendWhich transport backend to use. Defaults to smtp.
templates_path: StringDirectory that contains .md template files. Defaults to "emails".
default_from_name: StringDisplay name used in the From header when no per-email sender is set.
default_from_email: StringEmail address used in the From header when no per-email sender is set.
default_reply_to: Option<String>Optional default Reply-To address.
cache_templates: boolWhether to cache compiled email templates. Defaults to true.
Set to false in development for live template reloading.
template_cache_size: usizeMaximum number of compiled templates to keep in cache.
Defaults to 100. Only used when cache_templates is true.
smtp: SmtpConfigSMTP connection settings. Requires the smtp feature.
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