Represents a single email message: an outbound send that is queued, retrying, completed or failed, or an inbound email received into a profile's internal inbox when a recipient profile is set. An email item may be linked to a BaseEmailJob for a bulk send, generated by an EmailTrigger, or created individually for a one-off notification. It tracks delivery status and retry attempts, read and click tracking used for engagement reporting, and any attachments via EmailAttachment.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| attachments | List<EmailAttachment> | The files attached to this email. |
| bccList | String | The bcc recipient addresses for this email, as a single delimited string. |
| ccList | String | The cc recipient addresses for this email, as a single delimited string. |
| clusterVersion | String | Identifies which server cluster is responsible for sending this email item. |
| contentLanguage | String | The content language of the email body. |
| contentStorageType | String | Identifies where this email's body content is stored. Null means the html and text fields hold the content directly, otherwise this is an identifier telling EmailContentService which external store to use. |
| createdDate | Date | The date and time this email item was created. |
| disposition | String | The content disposition recorded for this email's body. |
| edmConverted | Boolean | Whether the recipient clicked a tracked link in this email, indicating engagement. |
| emailReferences | String | The chain of Message-IDs this email references, used to thread email conversations. |
| emailSendAttempts | List<EmailSendAttempt> | The history of SMTP delivery attempts made for this email item. |
| emailTrigger | EmailTrigger | The trigger configuration that caused this email to be generated, when it was sent automatically rather than by a job or a direct send. |
| encoding | String | The character encoding used for the email body. |
| forceSend | Boolean | Whether this email should be sent even when its job is not active. Has no effect when there is no job. |
| fromAddress | String | The from address this email was sent as. |
| hidden | Boolean | Whether this email should be hidden from the recipient's inbox page. |
| html | String | The fully rendered HTML body of the email, after any template has been applied. |
| id | long | The database identity of this email item. |
| ignored | Boolean | Whether this email item should be excluded from statistics and reporting counts. |
| inReplyTo | String | The Message-ID this email is a reply to, used to thread email conversations. |
| job | BaseEmailJob | The job which caused this email to be sent, when it was generated as part of a bulk send. |
| lastAttempt | EmailSendAttempt | The most recent SMTP delivery attempt recorded for this email item. |
| messageId | String | The unique message identifier assigned by the sending mail system, such as Amazon SES. |
| messageSize | int | The size in bytes of the rendered email message. |
| nextAttempt | Date | The date and time the next delivery retry is scheduled for. |
| numAttempts | Integer | The number of attempts made at SMTP delivery so far. |
| originatingOrg | Organisation | The organisation responsible for creating this email, whether via an email job, a trigger, or a direct send. |
| pending | boolean | Whether the send status has been set to any non-null value. Despite the name this is true whenever a status has been recorded at all, not only when the status is specifically pending. |
| readStatus | boolean | Whether this email has been read. Set to true either because it was read on the website, or because the email was determined to have been opened in an external email reader via a tracking image callback. |
| readyToSend | boolean | Whether this email item is eligible to be (re)sent: the send status is either null, meaning it has never been attempted, or set to retry. |
| recipient | BaseEntity | The account this email is addressed to. |
| recipientAddress | String | The email address this message was actually sent to. |
| replyToAddress | String | The reply-to address recipients should use when replying to this email. |
| reqFrom | String | The source address of the read-tracking pixel request that marked this email as opened, as captured from the request. |
| sender | Profile | The profile who sent this email, when it was sent by an internal user action. |
| sendStatus | String | The send status code for this email item: null when queued and not yet attempted, f for failed, c for completed, p for pending or in progress, or r for retry. |
| sendStatusDate | Date | The timestamp of the current send status, updated whenever the status changes, for example when the item is queued, sent, retried or fails. |
| statusText | String | A short human-readable label describing the current status of this email item: converted, opened, queued, complete, failed, pending or retrying. |
| subject | String | The email's subject line. |
| text | String | The plain text body of the email. |
| toList | String | The primary recipient addresses for this email, as a single delimited string. |
| userAgent | String | The user agent string captured from the read-tracking pixel request, identifying the client used to open the email. |
| visitedUrl | String | The first URL the recipient visited after clicking a link in this email, captured for conversion tracking. |
Methods
isPending() · getId() · getAttachments() · getJob() · getSender() · getRecipient() · getRecipientAddress() · getFromAddress() · getReplyToAddress() · getSubject() · getHtml() · getText() · getCreatedDate() · getSendStatus() · getSendStatusDate() · isReadStatus() · getEmailSendAttempts() · getMessageSize() · getDisposition() · getBccList() · getCcList() · getContentLanguage() · getEncoding() · getToList() · getOriginatingOrg() · getContentStorageType() · getInReplyTo() · getEmailReferences() · getClusterVersion() · complete() · failed() · getNextAttempt() · getNumAttempts() · getEmailTrigger() · getHidden() · getForceSend() · forceSend() · getEdmConverted() · isIgnored() · getMessageId() · getReqFrom() · getVisitedUrl() · getUserAgent() · isReadyToSend() · getStatusText() · getLastAttempt()
isPending()
Returns: boolean
Whether the send status has been set to any non-null value. Despite the name this is true whenever a status has been recorded at all, not only when the status is specifically pending.
getId()
Returns: long
The database identity of this email item.
getAttachments()
Returns: List<EmailAttachment>
The files attached to this email.
getJob()
Returns: BaseEmailJob
The job which caused this email to be sent, when it was generated as part of a bulk send.
getSender()
Returns: Profile
The profile who sent this email, when it was sent by an internal user action.
getRecipient()
Returns: BaseEntity
The account this email is addressed to.
getRecipientAddress()
Returns: String
The email address this message was actually sent to.
getFromAddress()
Returns: String
The from address this email was sent as.
getReplyToAddress()
Returns: String
The reply-to address recipients should use when replying to this email.
getSubject()
Returns: String
The email's subject line.
getHtml()
Returns: String
The fully rendered HTML body of the email, after any template has been applied.
getText()
Returns: String
The plain text body of the email.
getCreatedDate()
Returns: Date
The date and time this email item was created.
getSendStatus()
Returns: String
The send status code for this email item: null when queued and not yet attempted, f for failed, c for completed, p for pending or in progress, or r for retry.
getSendStatusDate()
Returns: Date
The timestamp of the current send status, updated whenever the status changes, for example when the item is queued, sent, retried or fails.
isReadStatus()
Returns: boolean
Whether this email has been read. Set to true either because it was read on the website, or because the email was determined to have been opened in an external email reader via a tracking image callback.
getEmailSendAttempts()
Returns: List<EmailSendAttempt>
The history of SMTP delivery attempts made for this email item.
getMessageSize()
Returns: int
The size in bytes of the rendered email message.
getDisposition()
Returns: String
The content disposition recorded for this email's body.
getBccList()
Returns: String
The bcc recipient addresses for this email, as a single delimited string.
getCcList()
Returns: String
The cc recipient addresses for this email, as a single delimited string.
getContentLanguage()
Returns: String
The content language of the email body.
getEncoding()
Returns: String
The character encoding used for the email body.
getToList()
Returns: String
The primary recipient addresses for this email, as a single delimited string.
getOriginatingOrg()
Returns: Organisation
The organisation responsible for creating this email, whether via an email job, a trigger, or a direct send.
getContentStorageType()
Returns: String
Identifies where this email's body content is stored. Null means the html and text fields hold the content directly, otherwise this is an identifier telling EmailContentService which external store to use.
getInReplyTo()
Returns: String
The Message-ID this email is a reply to, used to thread email conversations.
getEmailReferences()
Returns: String
The chain of Message-IDs this email references, used to thread email conversations.
getClusterVersion()
Returns: String
Identifies which server cluster is responsible for sending this email item.
complete()
Returns: boolean
Whether this email item completed sending successfully. See getSendStatus for the other possible states.
failed()
Returns: boolean
Whether this email item failed to send. See getSendStatus for the other possible states.
getNextAttempt()
Returns: Date
The date and time the next delivery retry is scheduled for.
getNumAttempts()
Returns: Integer
The number of attempts made at SMTP delivery so far.
getEmailTrigger()
Returns: EmailTrigger
The trigger configuration that caused this email to be generated, when it was sent automatically rather than by a job or a direct send.
getHidden()
Returns: Boolean
Whether this email should be hidden from the recipient's inbox page.
getForceSend()
Returns: Boolean
Whether this email should be sent even when its job is not active. Has no effect when there is no job.
forceSend()
Returns: boolean
Null-safe primitive accessor for getForceSend.
getEdmConverted()
Returns: Boolean
Whether the recipient clicked a tracked link in this email, indicating engagement.
isIgnored()
Returns: Boolean
Whether this email item should be excluded from statistics and reporting counts.
getMessageId()
Returns: String
The unique message identifier assigned by the sending mail system, such as Amazon SES.
getReqFrom()
Returns: String
The source address of the read-tracking pixel request that marked this email as opened, as captured from the request.
getVisitedUrl()
Returns: String
The first URL the recipient visited after clicking a link in this email, captured for conversion tracking.
getUserAgent()
Returns: String
The user agent string captured from the read-tracking pixel request, identifying the client used to open the email.
isReadyToSend()
Returns: boolean
Whether this email item is eligible to be (re)sent: the send status is either null, meaning it has never been attempted, or set to retry.
getStatusText()
Returns: String
A short human-readable label describing the current status of this email item: converted, opened, queued, complete, failed, pending or retrying.
getLastAttempt()
Returns: EmailSendAttempt
The most recent SMTP delivery attempt recorded for this email item.