azure_functions/send_grid/
bcc_settings.rs

1use serde::{Deserialize, Serialize};
2
3/// Represents bcc settings for an email message.
4///
5/// The specified email will receive a blind carbon copy (BCC) of
6/// the very first personalization defined for an email message.
7#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8pub struct BccSettings {
9    /// The value indicating whether this setting is enabled.
10    pub enable: bool,
11    /// The email address that will receive the BCC.
12    pub email: String,
13}
14
15#[cfg(test)]
16mod tests {
17    use super::*;
18    use serde_json::to_string;
19
20    #[test]
21    fn it_serializes_to_json() {
22        let json = to_string(&BccSettings {
23            enable: true,
24            email: "foo@example.com".to_owned(),
25        })
26        .unwrap();
27
28        assert_eq!(json, r#"{"enable":true,"email":"foo@example.com"}"#);
29    }
30}