azure_functions/send_grid/
click_tracking.rs

1use serde::{Deserialize, Serialize};
2
3/// Represents the ability to track whether a recipient clicked a link in the email message.
4#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5pub struct ClickTracking {
6    /// The value indicating whether this setting is enabled.
7    pub enable: bool,
8    /// The value indicating if this setting should be included in the text/plain portion of the email message.
9    pub enable_text: bool,
10}
11
12#[cfg(test)]
13mod tests {
14    use super::*;
15    use serde_json::to_string;
16
17    #[test]
18    fn it_serializes_to_json() {
19        let json = to_string(&ClickTracking {
20            enable: true,
21            enable_text: false,
22        })
23        .unwrap();
24
25        assert_eq!(json, r#"{"enable":true,"enable_text":false}"#);
26    }
27}