Skip to main content

email_clients/
configuration.rs

1#[cfg(feature = "smtp")]
2use crate::clients::smtp;
3
4#[cfg(feature = "terminal")]
5use crate::clients::terminal;
6
7#[cfg(feature = "memory")]
8use crate::clients::memory;
9
10#[cfg(feature = "mailersend")]
11use crate::clients::mailersend;
12
13#[derive(Debug, Clone, serde::Deserialize)]
14pub enum EmailConfiguration {
15    #[cfg(feature = "terminal")]
16    Terminal(terminal::TerminalConfig), // Output to terminal (sender)
17    #[cfg(feature = "smtp")]
18    SMTP(smtp::SmtpConfig), // Use smtp passwords and options (all config)
19    #[cfg(feature = "memory")]
20    Memory(memory::MemoryConfig), // Use in memory client
21    #[cfg(feature = "mailersend")]
22    Mailersend(mailersend::MailerSendConfig), // Use mailersend client
23}
24
25#[cfg(feature = "terminal")]
26impl Default for EmailConfiguration {
27    fn default() -> Self {
28        Self::Terminal(terminal::TerminalConfig::default())
29    }
30}