azure_functions/send_grid/
footer_settings.rs

1use serde::{Deserialize, Serialize};
2
3/// Represents footer settings for an email message.
4#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5pub struct FooterSettings {
6    /// The value indicating whether this setting is enabled.
7    pub enable: bool,
8    /// The plain text content of the footer.
9    pub text: String,
10    /// The HTML content of the footer.
11    pub html: String,
12}
13
14#[cfg(test)]
15mod tests {
16    use super::*;
17    use serde_json::to_string;
18
19    #[test]
20    fn it_serializes_to_json() {
21        let json = to_string(&FooterSettings {
22            enable: true,
23            text: "hello".to_owned(),
24            html: "world".to_owned(),
25        })
26        .unwrap();
27
28        assert_eq!(json, r#"{"enable":true,"text":"hello","html":"world"}"#);
29    }
30}