Email Trigger V2

Discover more about the Email Trigger V2 and how to use it on the Digibee Integration Platform.

Email Trigger V2 retrieves data from an email inbox and delivers it to the pipeline.

This trigger supports IMAP protocol only.

Parameters

Take a look at the configuration parameters for the trigger. Parameters supported by Double Braces expressions are marked with (DB).

Parameter
Description
Default value
Data type

Account

Defines the account type used by the trigger. Supported types: Basic, OAuth 2, and Azure Key.

N/A

String

E-mail

The email address to be accessed. If the account type is OAuth 2, only Google-hosted email addresses are supported. For Microsoft email addresses, use the Azure Key account type instead.

N/A

String

Operation

Specifies the action to be performed by the trigger. Options: Mark as Read, Move to Another Folder, and Delete. See details in the Operations section.

Mark as Read

String

Hostname

IMAP server hostname (for example, imap.uol.com).

imap.gmail.com

String

Port

Port number for the IMAP connection.

993

Integer

Email Folder

Name of the folder/inbox that the trigger will read (for example, inbox). This folder must not contain more than 100 messages (read or unread).

inbox

String

Destination Email Folder

Defines the folder where messages should be moved. This field is displayed only when Move to Another Folder is selected in the Operation parameter.

N/A

String

Maximum Timeout

Maximum processing time (in milliseconds) before the pipeline returns a response. Limit: 900000.

30000

Integer

Allow Redelivery Of Messages

If enabled, allows messages to be redelivered if the Pipeline Engine fails.

False

Boolean

Documentation

Section for documenting any necessary information about the connector configuration and business rules.

N/A

String

Operations

  • Mark as Read: Marks the message as read after processing.

  • Move to Another Folder: Moves the processed message to a specified folder. The Destination Email Folder field is required for this option.

  • Delete: Deletes the message after processing.

Attachments

If the received email contains attachments, they will be downloaded and stored in the pipeline's execution directory. The attachment names will be listed in the attachments property as an array of strings.

If two attachments have the same name, a unique identifier is added to differentiate them

Example

If an email contains two attachments named file.csv, the attachments property will be:

{
    "attachments": ["file.csv", "0072e485-8ba2-4f79-bba5-8068e37ee792_file.csv"]
}

The identifier varies with each execution.

When using Gmail as the IMAP server, you must enable access for less secure apps. Refer to Google's external documentation for details.

Usage example

Follow the steps below to configure and use the trigger:

  1. Open the trigger settings and select the email-v2 type.

  2. Fill in the configuration fields as needed. For this example, choose Mark as Read in the Operation field.

  3. Click Confirm.

  4. Deploy the pipeline. Learn step-by-step.

Once triggered, the pipeline will receive a payload similar to this:

{
  "textMessage": "",
  "htmlMessage": "Hello, Peter\r\nI still haven’t received the report for this month. Could you send it by the end of the day?",
  "attachments": [
    "attachment_fileName1",
    "attachment_fileName2",
    "attachment_fileName3"
  ],
  "subject": "Monthly report",
  "from": [
    "Renato Peixe Junior <[email protected]>"
  ],
  "to": [
    "[email protected]"
  ],
  "cc": [],
  "bcc": [],
  "replyTo": [
    "Renato Peixe Junior <[email protected]>"
  ],
  "sentDate": "2020-02-10T17:54:40Z[UTC]",
  "receivedDate": "2020-02-10T17:54:52Z[UTC]"
}

Payload fields

  • textMessage: Plain text content of the email.

  • htmlMessage: HTML-formatted content of the email.

  • attachments: List of attachment filenames.

  • subject: Email subject.

  • from: Sender's email address.

  • to: Recipient's email address.

  • cc: Recipients in carbon copy.

  • bcc: Recipients in blind carbon copy.

  • replyTo: Email address for replies.

  • sentDate: Timestamp when the email was sent.

  • receivedDate: Timestamp when the email was received.

Last updated

Was this helpful?