pub mod address;
pub mod config;
pub mod encode;
pub mod fake;
pub mod mailable;
pub mod message;
pub mod notification;
pub mod smtp;
pub mod transport;
pub use address::{Address, IntoAddress};
pub use config::{MailConfig, TransportKind};
pub use fake::Fake;
pub use mailable::{Mailable, html_to_text};
pub use message::{Attachment, Message};
pub use notification::{Delivery, Notification, Notified, Notifier, Recipient, channel};
pub use smtp::{Encryption, Reply, SmtpClient, SmtpConfig};
pub use transport::{FileTransport, LogTransport, Mailer, SmtpTransport, Transport};
use rustlavel_core::{Config, Result};
use std::path::PathBuf;
pub struct Mail;
impl Mail {
pub fn from_config(config: &Config) -> Result<Mailer> {
Mailer::from_config(config)
}
pub fn fake() -> Mailer {
Mailer::new(transport::LogTransport::silent()).faking(Fake::new())
}
pub fn log() -> Mailer {
Mailer::new(transport::LogTransport::new())
}
pub fn file(path: impl Into<PathBuf>) -> Mailer {
Mailer::new(transport::FileTransport::new(path))
}
pub fn smtp(settings: SmtpConfig) -> Mailer {
Mailer::new(transport::SmtpTransport::new(settings))
}
}