Skip to main content

mail_list/
email_builder.rs

1#[derive(Default, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
2pub struct EmailEnvelopeDetails {
3    pub to: String,
4    pub subject: String,
5    pub body: String,
6}
7
8impl EmailEnvelopeDetails {
9    pub fn new() -> Self {
10        Self::default()
11    }
12
13    pub fn set_to(mut self, to: &str) -> Self {
14        self.to = to.to_string();
15
16        self
17    }
18
19    pub fn set_subject(mut self, subject: &str) -> Self {
20        self.subject = subject.to_string();
21
22        self
23    }
24
25    pub fn set_body(mut self, body: &str) -> Self {
26        self.body = body.to_string();
27
28        self
29    }
30}