Genpact Cora Knowledge Center

Support

Email Listener Activity Overview

V8.8.5 and V9.3.1

Overview

Use the Email Listener Activity to listen to an email inbox and start a dynamic workflow when a new email arrives to the inbox. You can then use the returned email object in other workflow stages.

IMPORTANT: The JES executes this activity. Therefore, you must grant permissions to the workflow and activity to the user that runs the JES service.

If you copy a workflow that contains an Email Listener Activity, the new workflow has an Email Listener Activity with same associated job definition. So now, two Email Listener Activities will use the same job definition, which is not supported in Cora SeQuence.

In the new workflow, delete the existing Email Listener Activity from the copied workflow, and create and configure a new activity with a new job definition. 

Use case

At a customer service center, start a service request workflow for the relevant team when an email is received from a specific customer.

Configure email listener activity in workflow

Add an email listener activity in your workflow, and double click to configure. On the Job Definition window, the settings on the Job and the Advanced options tab are similar to any other job activity, and doesn't need any changes. Configure the Command tab to listen to a mailbox.

On the Job tab:

  • Name: name of the activity.
  • Job Instance: the list includes each server on which the JES (Job Execution Service) is installed.
  • Job is enabled: we recommend that you enable the job only after you completely develop the workflow, or workflow execution testing has started.

On the Command tab:

  • Protocol:
    • EWS
    • Graph API (most recommended)
    • IMAP
    • POP3

Based on the selected protocol, different fields from the following appear on the Command tab.

  • Email Server: add the email server to connect to, for example outlook.office365.com
  • SSL: select the option based on the email server configuration.
  • Port: default port set per the selected SSL Option. It can be overwritten.
  • Mailbox and credentials: mailbox that needs to be listened to.
  • Target email: the SMTP email address.
  • Action: the action to be performed on the emails received, move to a specific folder or delete.
  • Source folder: the folder from where the messages will be processed.
  • Target folder: the folder where processed messages will be stored, in case of 'Move to folder' action selected. Disabled for action selected as 'Delete'.
  • Include message attachments and linked resources: Cora SeQuence saves email attachments and linked resources.
  • Save message content as attachment: Cora SeQuence saves message as .eml file for Graph API, and .msg file for other protocols.

To connect to Microsoft Office 365 with EWS, define the following settings:

  • Email Server
  • SSL
  • Port
  • Mailbox and credentials
  • Target email
  • Action
  • Source folder
  • Target folder
  • Include message attachments and linked resources
  • Save message content as attachment

IMPORTANT:
Microsoft has announced to no longer support basic authentication for several email protocols. For more information, see this page.
We recommend to use the Graph API protocol or the EWS protocol with OAuth 2.0.

On the Advanced options tab:

  • Job execution schedule: sets a schedule for job run.
  • Delay job start: delays the job start.
  • Stop job if it executes more than: stops the job after set time.

Limitation

In case of high volume of requests across all applications, the Graph API protocol for Email Listener encounters throttling, and limits any more requests from the client for a specific time period. In such scenario, the system displays an error status code 429, and the requests fail. Wait for the recommended Retry-After delay, and try the request again.

Best practice

As a best practice, consider one of the following:

  • reducing the number of operations per request.
  • reducing the frequency of requests.

This can be achieved by one of the following:

  • splitting the job to two or more inboxes.
  • using several JES with no specific host predefined. Thus hosting the job to least busy JES.

V9.3 and earlier (except 8.8.5)

Context

Use the Email Listener Activity to listen to an email inbox and start a dynamic workflow when a new email arrives to the inbox. You can then use the returned email object in other workflow stages.

IMPORTANT: The JES executes this activity. Therefore, you must grant permissions to the workflow and activity to the user that runs the JES service.

Limitation

If you copy a workflow that contains an Email Listener Activity, in the copied workflow, you need to delete and then create a new Email Listener Activity.

This is necessary, because when you copy a workflow that contains an Email Listener Activity, the associated job definition is not copied. This causes two Email Listener Activities to use the same job definition, and this functionality is not supported. The Email Listener Activity in the copied workflow needs to be recreated with a new job definition. To do this, delete the Email Listener Activity from the copied workflow, then create and configure a new Email Listener Activity.

Use cases

  • At a customer service center, start a service request workflow for the relevant team when an email is received from a specific customer.

Add and configure email listener activity in workflow

Add an email listener activity in your workflow, and double click the activity to configure. On the Job Definition window, there are three tabs that require configuration: Job, Command, and Advanced options. The settings on Job and Advanced options tab are similar to any other job activity, and doesn't need any changes. The main settings are done on the Command tab.

  • On the Job tab:
    • Job Host: the list includes each server on which the JES (Job Execution Service) is installed.
    • Job is enabled: we recommend that you enable the job only after you completely develop the workflow, or workflow execution testing has started.
  • On the Command tab:
    • Protocol settings:
      • EWS
      • POP3
      • IMAP
    • Include message attachments and linked resources: saves email attachments and linked resources.
    • Save message content as attachment: saves message as .msg file.

To connect to Microsoft Office 365 with EWS, define the following settings:

  • Protocol: EWS
  • Email Server: outlook.office365.com
  • SSL: Implicit
  • Port: default port set per the selected SSL Option. It can be overwritten.
  • Mailbox and credentials: mailbox that needs to be listened to.
  • Target email: the SMTP email address.
  • Source folder: the folder from where the messages will be processed.
  • Action: the action to be performed on the emails received, move to a specific folder or delete.
  • Target folder: the folder where processed messages will be stored, in case of 'Move to folder' action selected. Disabled for action selected as 'Delete'.
  • Include message attachments and linked resources: Cora SeQuence saves email attachments and linked resources.
  • Save message content as attachment: Cora SeQuence saves message as .msg file.