Skip to content

Email received

Starts when an email is received in the connected email account.

@lainstack/email/received-trigger · Triggers

Key @lainstack/email/received-trigger (“Email received”). Starts a run for each email that arrives in a connected email account. Choose it for inbox-driven work.

References use the type key @lainstack/email/received-trigger as the source blockId, never the block instance id.

Payload leaves:

  • payload.data.from, payload.data.to (list), payload.data.cc (list), payload.data.subject.
  • payload.data.emailRef: the message as a file.
  • payload.data.attachments: attached files.
  • payload.system.credentialId, payload.system.accountEmail, payload.system.messageId, payload.system.inReplyTo, payload.system.references (list), payload.system.receivedAt.

Traps:

  • There is no body text leaf. The message content is in the file emailRef.
  • The account is polled about once a minute, so runs start with a delay.
  • Every email starts a run. The trigger has no filter. Filter with @lainstack/flow/condition as the first block (javascript.predicate).
  • credentialId must be an active Outlook email connection. The trigger cannot install otherwise.
  • inReplyTo has no value for a message that is not a reply.
  • A test run takes trigger data from a pinned sample (testing).
Setting Key Type Details
Connection (required) credentialId Connection The email connection to listen on.
Output Path Type
From payload.data.from Email address
To payload.data.to List
Cc payload.data.cc List
Subject payload.data.subject Text
Email payload.data.emailRef Value
Attachments payload.data.attachments Value
Credential Id payload.system.credentialId Text
Account Email payload.system.accountEmail Email address
Message Id payload.system.messageId Text
In Reply To payload.system.inReplyTo Text
References payload.system.references List
Received At payload.system.receivedAt Text