pub struct EmailConfig {
pub provider: String,
pub from: String,
pub from_name: String,
pub reply_to: String,
pub api_key: String,
pub api_secret: String,
pub region: String,
pub domain: String,
pub timeout_secs: u64,
pub smtp: SmtpConfig,
}Expand description
Outbound email: which provider sends it, and the credentials to do so.
Off by default (provider = "none"): an app that never sends mail carries
no configuration and no client. Turning it on is one line plus a key, and
every provider is reached through the same send_email call from a
function — swapping SendGrid for SES is a config change, not a code change.
Fields§
§provider: Stringnone (default), smtp, ses, sendgrid, brevo (aka sendinblue),
mailjet, mailgun, postmark or resend.
from: StringEnvelope sender, e.g. no-reply@example.com. Required once enabled; a
message may override it per-send.
from_name: StringDisplay name shown beside from.
reply_to: StringDefault Reply-To. Empty = none.
api_key: StringThe provider’s API key. For ses this is the AWS access key id; for
mailjet the public key; for smtp it is unused (see SmtpConfig).
api_secret: StringThe second half of a two-part credential: the AWS secret access key for
ses, the private key for mailjet. Unused elsewhere.
region: StringAWS region for ses, e.g. eu-west-1.
domain: StringSending domain for mailgun, e.g. mg.example.com.
timeout_secs: u64How long one send may take before it is abandoned.
smtp: SmtpConfigConnection details for provider = "smtp".
Implementations§
Trait Implementations§
Source§impl Clone for EmailConfig
impl Clone for EmailConfig
Source§fn clone(&self) -> EmailConfig
fn clone(&self) -> EmailConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more