Email Integration processing

Email integration processes an external email account and creates a Client Service Case (dataform). The Email Integration scheduled process performs multiple actions to process the emails and save them as a case.

Action

Description

Credentials

The credential is looked up from the API Credentials table using the Application Code that matches the mailbox being searched.

Unread emails are downloaded

The list of unread emails is downloaded.

Determine workspace

  • If Always use Default Workspace is selected, the system uses the Default Workspace ID.
  • The Email Alias is looked up based on the email To address. If a match is found, it uses this to determine the workspace.
  • The body is searched for the CLID (Client Number) token, and if found, the business object is called to interpret the CLID and return the appropriate workspace ID++++.
  • The body is searched for the WSID token, and if found, and the workspace was not set by the business object CLID request, the workspace ID is set to the WSID value.
  • The email From address is compared to all employee email addresses (both Personal and Work email) in the system and tries to match the email. If a match is found, the workspace associated with that employee is used and if multiple instances of the employee email (Personal and Work) exist, the most recently changed instance is used. The email addresses are used for workspace lookup purposes to determine where to generate the case.
  • If no workspace is determined, the contacts are searched for one with the same email as the email From address. If found, the primary project ID for the contact is used as the workspace ID and the Client Contact information on the newly created Client Service case is updated using the "From" email address from the matching contact record.
  • If the contact is not found, the Organization table is searched for an organization with the same email domain. If found, the default workspace for this organization is used.
  • If no workspace is found, the default workspace from the alias is used along with the project type to create the appropriate data form.

Body scanned

  • When the dataform type and workspace are found, the body is scanned for additional data value tokens that are added to the form data XML document in addition to the email data items to set valid fields.
  • Any invalid special characters found in the email subject and body are scrubbed. This process does not log an error message.

Business object

  • If a business object is specified, the EmailIntegrationCreateNewForm is called to allow the business layer to set data values before creating the form.
  • If the Business Object does not cancel the save, then the dataform is saved.

Dataform saved

The attachments are downloaded and attached to the form based on the alias Include Attachments indicator.

XML document

In addition to the email fields, the saved data is placed into an XML document to generate the reply message.

Set data values

If a business object is specified, the EmailIntegrationNotifySender is called to allow the business layer to set data values before generating and transmitting the notification.

Notification sent

If the business object does not cancel the notify action, then the notification is sent.

Marked as read

The email is then marked as read.