use serde::Deserialize;
#[derive(Debug, Clone, Deserialize)]
pub struct EmailConfig {
pub host: String,
#[serde(default = "default_port")]
pub port: u16,
pub username: String,
pub password: String,
pub from: String,
#[serde(default = "default_encryption")]
pub encryption: String,
#[serde(default = "default_otp_expiry")]
pub otp_expiry_secs: u64,
}
fn default_port() -> u16 {
587
}
fn default_encryption() -> String {
"starttls".to_string()
}
fn default_otp_expiry() -> u64 {
600
}