pub struct Message {Show 22 fields
pub id: MessageId,
pub grant_id: GrantId,
pub thread_id: Option<ThreadId>,
pub subject: Option<String>,
pub from: Vec<EmailAddress>,
pub to: Vec<EmailAddress>,
pub cc: Vec<EmailAddress>,
pub bcc: Vec<EmailAddress>,
pub reply_to: Vec<EmailAddress>,
pub date: i64,
pub unread: Option<bool>,
pub starred: Option<bool>,
pub snippet: Option<String>,
pub body: Option<String>,
pub attachments: Vec<Attachment>,
pub folders: Vec<FolderId>,
pub created_at: Option<i64>,
pub headers: Option<Vec<EmailHeader>>,
pub raw_mime: Option<String>,
pub bounce_detected: Option<bool>,
pub schedule_id: Option<ScheduleId>,
pub send_at: Option<i64>,
}Expand description
A message object from the Nylas API.
Messages are email messages in a user’s mailbox.
§Example
let message = Message {
id: MessageId::new("msg_123"),
grant_id: GrantId::new("grant_123"),
thread_id: Some(ThreadId::new("thread_123")),
subject: Some("Hello".to_string()),
from: vec![],
to: vec![],
cc: vec![],
bcc: vec![],
reply_to: vec![],
date: 1234567890,
unread: Some(false),
starred: Some(false),
snippet: Some("Message snippet...".to_string()),
body: Some("Message body".to_string()),
attachments: vec![],
folders: vec![],
created_at: Some(1234567890),
headers: None,
raw_mime: None,
bounce_detected: None,
schedule_id: None,
send_at: None,
};Fields§
§id: MessageIdUnique identifier for the message.
grant_id: GrantIdGrant ID associated with this message.
thread_id: Option<ThreadId>Thread ID this message belongs to.
subject: Option<String>Subject line of the message.
from: Vec<EmailAddress>Sender email address(es).
to: Vec<EmailAddress>Recipient email address(es).
cc: Vec<EmailAddress>CC recipient email address(es).
bcc: Vec<EmailAddress>BCC recipient email address(es).
reply_to: Vec<EmailAddress>Reply-to email address(es).
date: i64Unix timestamp when the message was sent/received.
unread: Option<bool>Whether the message is unread.
starred: Option<bool>Whether the message is starred.
snippet: Option<String>Short snippet of the message body.
body: Option<String>Full body of the message.
attachments: Vec<Attachment>Attachments included with the message.
folders: Vec<FolderId>Folder IDs this message belongs to.
created_at: Option<i64>Unix timestamp when the message was created.
headers: Option<Vec<EmailHeader>>Email headers (returned when fields=include_headers is specified).
raw_mime: Option<String>Raw MIME data (Base64url-encoded, returned when fields=raw_mime is specified).
bounce_detected: Option<bool>Whether bounce was detected for this message.
schedule_id: Option<ScheduleId>Schedule ID if this message is scheduled to be sent.
send_at: Option<i64>Scheduled send time (Unix timestamp) if this message is scheduled.