Message

public final class Message implements IMessage

Class representing a Nylas Message object.

Constructors

Link copied to clipboard
public Message Message(@Json(name = "grant_id") String grantId, @Json(name = "from") List<EmailName> from, @Json(name = "object") String obj, @Json(name = "id") String id, @Json(name = "bcc") List<EmailName> bcc, @Json(name = "cc") List<EmailName> cc, @Json(name = "reply_to") List<EmailName> replyTo, @Json(name = "snippet") String snippet, @Json(name = "subject") String subject, @Json(name = "thread_id") String threadId, @Json(name = "body") String body, @Json(name = "starred") Boolean starred, @Json(name = "unread") Boolean unread, @Json(name = "folders") List<String> folders, @Json(name = "to") List<EmailName> to, @Json(name = "attachments") List<Attachment> attachments, @Json(name = "headers") List<MessageHeaders> headers, @Json(name = "created_at") Long createdAt, @Json(name = "date") Long date, @Json(name = "metadata") Map<String, Object> metadata, @Json(name = "schedule_id") String scheduleId, @Json(name = "send_at") Long sendAt)

Properties

Link copied to clipboard
private final List<Attachment> attachments

An array of files attached to the message.

Link copied to clipboard
private final List<EmailName> bcc

An array of bcc recipients.

Link copied to clipboard
private final String body

The full HTML message body. Messages with only plain-text representations are up-converted to HTML.

Link copied to clipboard
private final List<EmailName> cc

An array of cc recipients.

Link copied to clipboard
private final Long createdAt

Unix timestamp of when the message was created.

Link copied to clipboard
private final Long date

Unix timestamp of when the message was received by the mail server. This may be different from the unverified Date header in raw message object.

Link copied to clipboard
private final List<String> folders

The ID of the folder(s) the message appears in.

Link copied to clipboard
private final List<EmailName> from

An array of message senders.

Link copied to clipboard
private final String grantId

Grant ID of the Nylas account.

Link copied to clipboard
private final List<MessageHeaders> headers

The message headers. Only present if the 'fields' query parameter is set to includeHeaders.

Link copied to clipboard
private final String id

The unique identifier for the message. Note: The ID may not be present for scheduled messages until the message is sent.

Link copied to clipboard
private final Map<String, Object> metadata

A list of key-value pairs storing additional data.

Link copied to clipboard
private final List<EmailName> replyTo

An array of name and email pairs that override the sent reply-to headers.

Link copied to clipboard
private final String scheduleId

The ID of the scheduled message. Only present if the message was scheduled to be sent.

Link copied to clipboard
private final Long sendAt

The time the message was scheduled to be sent, in epoch time. Only present if the message was scheduled to be sent.

Link copied to clipboard
private final String snippet

A short snippet of the message body. This is the first 100 characters of the message body, with any HTML tags removed.

Link copied to clipboard
private final Boolean starred

Whether or not the message has been starred by the user.

Link copied to clipboard
private final String subject

The message subject.

Link copied to clipboard
private final String threadId

A reference to the parent thread object. If this is a new draft, the thread will be empty.

Link copied to clipboard
private final List<EmailName> to

An array of message recipients.

Link copied to clipboard
private final Boolean unread

Whether or not the message has been read by the user.

Functions

Link copied to clipboard
public final List<Attachment> getAttachments()

An array of files attached to the message.

Link copied to clipboard
public final List<EmailName> getBcc()

An array of bcc recipients.

Link copied to clipboard
public final String getBody()

The full HTML message body. Messages with only plain-text representations are up-converted to HTML.

Link copied to clipboard
public final List<EmailName> getCc()

An array of cc recipients.

Link copied to clipboard
public final Long getCreatedAt()

Unix timestamp of when the message was created.

Link copied to clipboard
public final Long getDate()

Unix timestamp of when the message was received by the mail server. This may be different from the unverified Date header in raw message object.

Link copied to clipboard
public final List<String> getFolders()

The ID of the folder(s) the message appears in.

Link copied to clipboard
public final List<EmailName> getFrom()

An array of message senders.

Link copied to clipboard
public final String getGrantId()

Grant ID of the Nylas account.

Link copied to clipboard
public final List<MessageHeaders> getHeaders()

The message headers. Only present if the 'fields' query parameter is set to includeHeaders.

Link copied to clipboard
public final String getId()

The unique identifier for the message. Note: The ID may not be present for scheduled messages until the message is sent.

Link copied to clipboard
public final Map<String, Object> getMetadata()

A list of key-value pairs storing additional data.

Link copied to clipboard
public final String getObject()

Get the type of object.

Link copied to clipboard
public final List<EmailName> getReplyTo()

An array of name and email pairs that override the sent reply-to headers.

Link copied to clipboard
public final String getScheduleId()

The ID of the scheduled message. Only present if the message was scheduled to be sent.

Link copied to clipboard
public final Long getSendAt()

The time the message was scheduled to be sent, in epoch time. Only present if the message was scheduled to be sent.

Link copied to clipboard
public final String getSnippet()

A short snippet of the message body. This is the first 100 characters of the message body, with any HTML tags removed.

Link copied to clipboard
public final Boolean getStarred()

Whether or not the message has been starred by the user.

Link copied to clipboard
public final String getSubject()

The message subject.

Link copied to clipboard
public final String getThreadId()

A reference to the parent thread object. If this is a new draft, the thread will be empty.

Link copied to clipboard
public final List<EmailName> getTo()

An array of message recipients.

Link copied to clipboard
public final Boolean getUnread()

Whether or not the message has been read by the user.