Email connector
High-level description
Email is a very common source of incoming data. Very often, a Bot needs to connect to the particular mailbox and read messages for further processing.
Email Connector is designed to have this capability already built for usage. It supports the most common Email protocols such as MS Exchange and IMAP. Mind that POP3 is not supported due to low usage.

How it works
The Email connector logic is absolutely the same for Exchange and IMAP protocols.
- Email connector connects to the target server folder with specified settings and fetches unread emails. If the Mark As Read flag is checked to
true, all emails will be marked as read. - Each email taken from the server represents the Transaction object. By default, each transaction has at least one document which presents the email message. It has all metadata such as From, To, Subject, CC, BCC, and message body as document content.
- The email message might contain an attachment that can be either an inline attachment, for example, an image embedded into the message, or an attached file. Email Connector creates a document as a part of the same transaction for each attachment and assigns the corresponding type.
The example of the Transaction created from an email with both types of attachments is shown below in the Transaction .json file.
{
"meta":{ },
"id":"65d96ce2-f7b9-48ad-91e8-726514d705a6",
"docs":[
{
"meta":{
"cc":"",
"bcc":"",
"subject":"sdsdfsdfsdf",
"from":"Maxim Turchin <mturchin@workfusion.com>",
"to":"rpa-coe-gf <rpa-coe-gf@workfusion.com>"
},
"doc_id":"e6228119-585d-48ca-9ff3-3890ac4332a5",
"doc_name":"sdsdfsdfsdf",
"doc_type":"Message",
"doc_text":"https://wfinst-307-92-ct1-s3.workfusion.com:443/intake-bucket/9d309a6b-e6f6-4380-bfdb-a6b35dc28989.html",
"doc_tagged_text":null,
"doc_original_link":null,
"doc_origin":null
},
{
"meta":{},
"doc_id":"68060f5a-1e54-4177-992d-cb444db3ad40",
"doc_name":"SharedFolderConnector.png",
"doc_type":"Attachments",
"doc_text":null,
"doc_tagged_text":null,
"doc_original_link":"https://wfinst-307-92-ct1-s3.workfusion.com:443/intake-bucket/39c902eb-c6e2-4395-9a93-13add261ea3f_SharedFolderConnector.png",
"doc_origin":null
},
{
"meta":{},
"doc_id":"03b4bce0-c888-41b5-a537-86fc012eb90f",
"doc_name":"image001.png",
"doc_type":"Inline Attachments",
"doc_text":null,
"doc_tagged_text":null,
"doc_original_link":"https://wfinst-307-92-ct1-s3.workfusion.com:443/intake-bucket/75807b16-5bbe-46d3-9e12-2c51383b70e8_image001.png",
"doc_origin":null
}
]
}
Email matching may lool like as follows.

How to use
Email Connector consists of two steps.
- Email server settings are configured in a Form view. There is a configuration template for Exchange and another template for IMAP.
- The Bot actually connects to the server with parameters passed from the previous step, gets email messages, and creates Transactions.
The example of such configuration is shown below.

Exchange settings
- To create the Exchange settings step, create an empty step first.

- Click on it and select the ETL section.

- Choose Exchange Mail Connector v0.4.

- Configure the form in accordance with your server settings.

The table below provides the full description of all parameters for the Exchange Mail settings.
| Parameter | Description | Required | Default Value |
|---|---|---|---|
| Server | Exchange server URL including the port unless it is default, for example: https://outlook.office365.com/EWS/Exchange.asmx | Yes | n/a |
| Domain | User domain | No | |
| Credentials Alias Name | Secret name taken from the Secret Vault. The secret entry key is a username, and the value is a password. | Yes | n/a |
| Exchange Version | Acceptable values: Exchange2007_SP1, Exchange2010, Exchange2010_SP1, Exchange2010_SP2. | Yes | MS Exchange 2010 SP2 |
| Input Folder | Target folder name from where email messages will be fetched. |
No | Default mail box folder. Usually, it is Inbox. |
| Mark as Read | Indicates whether the fetched email messages should be marked as read. | Yes | Yes |
| Copy or Move | Allows to move or copy read messages to the target folder. If no action is required, choose None. | Yes | None |
Copy/Move to |
Folder name where messages should be moved or copied to. |
No | n/a |
IMAP settings
To set up IMAP, follow the same steps as for Exchange settings, but choose IMAP Mail Connector v0.4 in the the ETL list.

The example of the configuration form is shown below.

The table below provides the full description of all parameters for the IMAP Mail settings.
| Parameter | Description | Required | Default Value |
|---|---|---|---|
| Host Name | Target server host without port indication. Example: Outlook.office365.com |
Yes | n/a |
| Port | Target server host number. The default port is 993 for IMAP. | Yes | 993 |
| Credentials Alias Name | Secret name taken from the Secret Vault. The secret entry key is a username, and the value is a password. | Yes | n/a |
| Use SSL | Indicates if the connection should be secured. The server also has to support this connection type. | Yes | Yes |
| Input Folder | The target folder name from where email messages will be fetched. For example, folder in Input should be addressed as **Input/folder_name**. |
No | Default mail box folder. Usually, it is Inbox. |
| Mark as Read | Indicates whether the fetched email messages should be marked as read. | Yes | Yes |
| Copy or Move | Allows to move or copy messages after it was read to the target folder. If no action is required, choose None | Yes | None |
Copy/Move to |
Folder name where messages should be moved or copied to. |
No | n/a |
Mail Connector step
After the Settings step is set up, you can drag-n-drop the Intake Bots v0.4 (Email Connector) Bot from Available Bots.
