rok-mail 0.1.0

Email support for the rok ecosystem — Mailable trait, log/SMTP drivers
Documentation
#[derive(Debug, Clone)]
pub struct MailConfig {
    /// Driver to use: "log" (default, prints to stdout) or "smtp".
    pub driver: String,
    /// Envelope from address.
    pub from_address: String,
    /// Display name for the from address.
    pub from_name: String,
    /// SMTP host (required when driver = "smtp").
    pub smtp_host: Option<String>,
    /// SMTP port. Default: 587.
    pub smtp_port: u16,
    /// SMTP username for authentication.
    pub smtp_username: Option<String>,
    /// SMTP password for authentication.
    pub smtp_password: Option<String>,
    /// Encryption mode: "starttls" (default), "tls", or "none".
    pub smtp_encryption: String,
    /// API key for the Postmark driver.
    pub postmark_api_key: Option<String>,
    /// API key for the Resend driver.
    pub resend_api_key: Option<String>,
}

impl Default for MailConfig {
    fn default() -> Self {
        Self {
            driver: "log".into(),
            from_address: "noreply@rok-app.com".into(),
            from_name: "rok-app".into(),
            smtp_host: None,
            smtp_port: 587,
            smtp_username: None,
            smtp_password: None,
            smtp_encryption: "starttls".into(),
            postmark_api_key: None,
            resend_api_key: None,
        }
    }
}