Support for Email Triggers

Posted under features on April 16 , 2018 by Koustubh Moharir


Version 2.9 introduces support for email triggers. This feature enables an activity to be configured so that it runs automatically for every incoming email in the Inbox of a specific Exchange mailbox that meets specific conditions. This feature currently uses the Exchange Web Services API and thus is limited to Exchange mailboxes. Support for listening to incoming email using the IMAP protocol will be added in a future release.

Email Connections need to be configured in the emailConnections.config file, newly introduced in version 2.9. Upgrading to 2.9 will automatically create a sample file that should be modified as required. Each email connection has a name, the email address and password of the mailbox to be monitored, the type of the connection (currently only EWS), and the version of the API to be used (default is Exchange2013_SP1).

To configure an activity to be run on incoming email, the activity must take a single eml or msg file as a file input. Other inputs (if any) must be static folders or must be usable with preset or default values. This restriction is necessary so that the activity can be run automatically in response to an incoming email. The incoming email will be used as the email file input and other inputs (if any) will get their preset or default values.

The rest of the configuration is currently provided as raw json when publishing the activity (using the Excel Addin). Expect this experience to improve significantly over future releases. The json has the form

{
  "ConnectionName": "name of connection",
  "EmailInputName": "name of activity input that accepts email file",
  "Condition": condition
}

where condition can either be a simple criterion of the form

{
  "Criterion": {
    "Field": "one of From|To|CC|Subject|HasAttachment",
    "Operation": "one of Equals|HasPrefix|HasSuffix|Contains|MatchesRegex",
    "Value": "value to match",
    "Negate": true|false
  }
}

or a set of conditions of the form

{
  "Conditions":[condition,condition,...],
  "Operation":"one of And|Or|NotAnd|NotOr"
}

The structure can be nested as deeply as required to limit the number of emails on which the activity will be run.

The ActivityRunner.exe process will monitor all mailboxes for which activities are configured to run automatically. If the monitoring stops due to a failure in connectivity or ActivityRunner.exe is shut down manually or it crashes, the monitoring will resume automatically once connectivity is restored or ActivityRunner.exe is restarted. Processing of emails may get delayed in such cases, but emails will not be missed.

Currently ActivityRunner needs to be restarted if there is a change to the emailConnections.config file or there is any change to an activity that is to be triggered via incoming email. Expect this requirement to be removed in a future release.



TAGGED:EmailTriggerConfigJSON


Let's talk

Address

7th floor, Unit No. 715, C Wing,
Kailas Business Park, S. Veer Savarkar Marg,
Park Site, Vikhroli (W), Mumbai-400079.

 

For General Queries & Technical Support

contactus@quantumphinance.com

 

For Sale and Demos

sales@quantumphinance.com