Skip to main content
Fires when a connected mailbox receives a message from outside the workspace and the message’s thread is a conversation in Custral.
Every message that fires email.received also fires email.replied, with the same payload. Subscribe to one of the two, or each message is handled twice.

Payload

string
required
The mail provider’s id for the message. Always present.
string
The mail provider’s id for the thread.
string
The connected mailbox the message arrived in.
string
The conversation the thread belongs to. Present on every delivery, because this event only fires for a thread that is a conversation.
string
The sender’s address.
string
The sender’s display name. Omitted when the message carries none.
string[]
The addresses the message was sent to.
string[]
The addresses copied. An empty array when nobody was copied.
string
The subject line. An empty string when the message has none.
string
The message’s date, as an ISO 8601 timestamp.
string
The provider’s id for the first folder or label the message is filed under. On a Microsoft mailbox this is an opaque id rather than a name. Omitted when the provider lists none.
string[]
Records the message is linked to. Mail from a connected mailbox does not carry them today, so this is omitted; look the conversation up by conversationId to see who it is with.

When it fires

  • The sender is outside the workspace. A message sent from any of the workspace’s connected mailboxes, a teammate’s included, delivers email.sent instead.
  • The thread is a conversation. A reply in a thread that is already a conversation counts. A new thread counts when the New mail handling setting, or the mailbox’s own override of it, turns it into one. Mail left in the inbox sends nothing.
  • The message is not in a spam folder. A message the provider files as spam or junk sends no email event at all.

What sends nothing

  • A blocked sender. Mail from a sender blocked on that mailbox is moved to the trash.
  • A repeat of the same message. Custral skips a message it has processed in the last five minutes. That includes a copy arriving in a second connected mailbox of the workspace, so the message is delivered once, with the channelId of whichever mailbox was processed first.

Worth knowing

  • No body. The payload carries the subject and the addressing. Read the message itself from the conversation through the Conversations API.
  • Ids belong to one mailbox. Each connected mailbox has its own messageId and threadId for the same mail. Key on conversationId to follow a conversation.

Example