rok-mail 0.1.0

Email support for the rok ecosystem — Mailable trait, log/SMTP drivers
Documentation
1
2
3
4
5
6
7
8
9
10
11
/// Implement this trait on any struct that represents a sendable email.
///
/// The `Send + Sync` bounds are required so that async handlers holding a
/// `Mailable` across an `.await` point compile without `Handler` bound errors.
pub trait Mailable: Send + Sync {
    fn subject(&self) -> &str;
    fn body(&self) -> String;
    fn html_body(&self) -> Option<String> {
        None
    }
}