mailslurp/models/email.rs
1/*
2 * MailSlurp API
3 *
4 * MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5 *
6 * The version of the OpenAPI document: 6.5.2
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Email : Email entity (also known as EmailDto). When an SMTP email message is received by MailSlurp it is parsed. The body and attachments are written to disk and the fields such as to, from, subject etc are stored in a database. The `body` contains the email content. If you want the original SMTP message see the `getRawEmail` endpoints. The attachments can be fetched using the AttachmentController
12
13
14
15#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Email {
17 #[serde(rename = "analysis", skip_serializing_if = "Option::is_none")]
18 pub analysis: Option<Box<crate::models::EmailAnalysis>>,
19 /// List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension.
20 #[serde(rename = "attachments", skip_serializing_if = "Option::is_none")]
21 pub attachments: Option<Vec<String>>,
22 /// List of `BCC` recipients email addresses that the email was addressed to. See recipients object for names.
23 #[serde(rename = "bcc", skip_serializing_if = "Option::is_none")]
24 pub bcc: Option<Vec<String>>,
25 /// The body of the email message as text parsed from the SMTP message body (does not include attachments). Fetch the raw content to access the SMTP message and use the attachments property to access attachments. The body is stored separately to the email entity so the body is not returned in paginated results only in full single email or wait requests.
26 #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
27 pub body: Option<String>,
28 /// An excerpt of the body of the email message for quick preview .
29 #[serde(rename = "bodyExcerpt", skip_serializing_if = "Option::is_none")]
30 pub body_excerpt: Option<String>,
31 /// A hash signature of the email message using MD5. Useful for comparing emails without fetching full body.
32 #[serde(rename = "bodyMD5Hash", skip_serializing_if = "Option::is_none")]
33 pub body_md5_hash: Option<String>,
34 /// List of `CC` recipients email addresses that the email was addressed to. See recipients object for names.
35 #[serde(rename = "cc", skip_serializing_if = "Option::is_none")]
36 pub cc: Option<Vec<String>>,
37 /// Detected character set of the email body such as UTF-8
38 #[serde(rename = "charset", skip_serializing_if = "Option::is_none")]
39 pub charset: Option<String>,
40 /// When was the email received by MailSlurp
41 #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
42 pub created_at: Option<String>,
43 /// Who the email was sent from. An email address - see fromName for the sender name.
44 #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
45 pub from: Option<String>,
46 /// Collection of SMTP headers attached to email
47 #[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
48 pub headers: Option<::std::collections::HashMap<String, String>>,
49 /// ID of the email entity
50 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
51 pub id: Option<String>,
52 /// ID of the inbox that received the email
53 #[serde(rename = "inboxId", skip_serializing_if = "Option::is_none")]
54 pub inbox_id: Option<String>,
55 /// Is the email body HTML
56 #[serde(rename = "isHTML", skip_serializing_if = "Option::is_none")]
57 pub is_html: Option<bool>,
58 /// Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks.
59 #[serde(rename = "read", skip_serializing_if = "Option::is_none")]
60 pub read: Option<bool>,
61 #[serde(rename = "recipients", skip_serializing_if = "Option::is_none")]
62 pub recipients: Option<Box<crate::models::EmailRecipients>>,
63 /// The `replyTo` field on the received email message
64 #[serde(rename = "replyTo", skip_serializing_if = "Option::is_none")]
65 pub reply_to: Option<String>,
66 #[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
67 pub sender: Option<Box<crate::models::Sender>>,
68 /// The subject line of the email message as specified by SMTP subject header
69 #[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
70 pub subject: Option<String>,
71 /// Can the email be accessed by organization team members
72 #[serde(rename = "teamAccess", skip_serializing_if = "Option::is_none")]
73 pub team_access: Option<bool>,
74 /// List of `To` recipient email addresses that the email was addressed to. See recipients object for names.
75 #[serde(rename = "to", skip_serializing_if = "Option::is_none")]
76 pub to: Option<Vec<String>>,
77 /// When was the email last updated
78 #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
79 pub updated_at: Option<String>,
80 /// ID of user that email belongs to
81 #[serde(rename = "userId", skip_serializing_if = "Option::is_none")]
82 pub user_id: Option<String>,
83}
84
85impl Email {
86 /// Email entity (also known as EmailDto). When an SMTP email message is received by MailSlurp it is parsed. The body and attachments are written to disk and the fields such as to, from, subject etc are stored in a database. The `body` contains the email content. If you want the original SMTP message see the `getRawEmail` endpoints. The attachments can be fetched using the AttachmentController
87 pub fn new() -> Email {
88 Email {
89 analysis: None,
90 attachments: None,
91 bcc: None,
92 body: None,
93 body_excerpt: None,
94 body_md5_hash: None,
95 cc: None,
96 charset: None,
97 created_at: None,
98 from: None,
99 headers: None,
100 id: None,
101 inbox_id: None,
102 is_html: None,
103 read: None,
104 recipients: None,
105 reply_to: None,
106 sender: None,
107 subject: None,
108 team_access: None,
109 to: None,
110 updated_at: None,
111 user_id: None,
112 }
113 }
114}
115
116