Automatically converting emails to cases
By default, ServiceJourney converts emails either into new Cases or attaches them to existing Cases. In certain advanced use-cases, you may want to change how parts of the email are mapped to a new Case. The mapping needs to be specified in a Base64 representation of an XML.
To add parameters in the XML we use the {} notation. For example, to insert the Summary content we use the following code
Steps to configure
- On the top right, navigate to → ServiceJourney
- On the left, navigate to → Case Management → Admin Settings → Email to Case
- Click on the next to the Id number and select Quick Modify
- Fill out the fields as needed, explanation of the settings are below
Properties of Email to Case
Property | Description |
---|---|
Case Type Name | Case Type name to create for incoming emails. For example, EMAIL. |
Case Create XML | Base64 encoded XML used to create a new Email Case. The following XML corresponds to the EMAIL Case Type You can use a website like https://www.base64decode.org/ to encode the XML Base64. |
Steps to building the "Case Create XML"
If your Email Case Type's data model has not been changed, then your XML before it was converted to Base 64 looks like below:
XML Example
<CustomData>
<Attributes>
<Object ObjectCode="CASE">
<Item>
<OBJECTCODE><![CDATA[CASE]]></OBJECTCODE>
<ID>-3</ID>
<PARENTID>0</PARENTID>
<PARENTCODE/>
<SUMMARY><![CDATA[{Summary}]]></SUMMARY>
<DESCRIPTION/>
<PRIORITY_ID>{MaxDCMPrio}</PRIORITY_ID>
<CASESYSTYPE_ID>22</CASESYSTYPE_ID>
{Team}
<DRAFT>0</DRAFT>
</Item>
</Object>
<Object ObjectCode="CDM_EMAIL">
<Item>
<CASETYPEID>22</CASETYPEID>
<OBJECTCODE><![CDATA[CDM_EMAIL]]></OBJECTCODE>
<PARENTID>-3</PARENTID>
<ID>-2</ID>
<PARENTCODE/>
<MODELID>83</MODELID>
<DOMOBJECTCODE><![CDATA[CDM_EMAIL]]></DOMOBJECTCODE>
<CDM_EMAIL_POTENTIALDUPLICATE>{Duplicate}</CDM_EMAIL_POTENTIALDUPLICATE>
{ExtraAttributes}
</Item>
</Object>
</Attributes>
</CustomData>
If your Email Case Type's data model has changed or you want for incoming emails to create a Case of a different type, then see article: How to Get the XML Structure of a Case Type
The XML uses handlebars {} to indicate dynamic content that is replaced with values extracted from the actual email or or with values that were calculated from the initial email processing.
Description of the available placeholders that can be used in the XML :
Parameter | Description | Source |
---|---|---|
{FromAddress} | The email address from the sender | Email → From |
{MaxDCMPrio} | The calculated priority code based on content | Email Router Config → Priority |
{Team} | The Team that the new email case will be assigned to | Email Router Config → DCM Team |
{Summary} | Case title | Email → Subject |
{DateNow} | System UTC date when the incoming email is processed | System → DateTime.UtcNow.ToString("dd-MMM-yyyy")); |
{Duplicate} | Marked email as duplicate | CUST_AER_CHECKPOTENTIALDUPLICATE rule |
{Initial_Queue_Name} | Queue name for routing email/case to | Email Router Config → Distribution Queue |
{Capture_Channel_Code} | Capture Channel Code that captured this email | Send Message Request XML → <SubmitRequest><CaptureItem><ChannelCode>SERVICE_JOURNEY_DEFAULT_CAPTURE</ChannelCode> |
{ExtraAttributes} | The result of a rule that uses a RegEx expression to get specific data, for example, the contract number. If a value is found, the result of the RegEx is stored in an attribute (for example Case Attribute Name=CONTRACTNR). Then this attribute would be added as ExtraAttributes and can be also used in the Create XML as {CONTRACTNR} | Email Router Config → Rule configuration → Case Attribute Name |
Converting the "Case Create XML" to Base64
Once you've formulated the XML, you need to convert it to XML before pasting it in the Case Create XML file above.
- Go to https://www.base64decode.org/
- Copy the encoded text to the Case Create XML
Technical note
By default, all incoming emails are processed by a special DLL called CUST_AER_CaptureIndexingEmail, which calls the DCM_createCaseWithOptions rule.
Default Base64 for backup
PEN1c3RvbURhdGE+PEF0dHJpYnV0ZXM+PE9iamVjdCBPYmplY3RDb2RlPSJDQVNFIj48SXRlbT48T0JKRUNUQ09ERT48IVtDREFUQVtDQVNFXV0+PC9PQkpFQ1RDT0RFPjxJRD4tMzwvSUQ+PFBBUkVOVElEPjA8L1BBUkVOVElEPjxQQVJFTlRDT0RFLz48U1VNTUFSWT48IVtDREFUQVt7U3VtbWFyeX1dXT48L1NVTU1BUlk+PERFU0NSSVBUSU9OLz48UFJJT1JJVFlfSUQ+e01heERDTVByaW99PC9QUklPUklUWV9JRD48Q0FTRVNZU1RZUEVfQ09ERT5FTUFJTDwvQ0FTRVNZU1RZUEVfQ09ERT57VGVhbX08RFJBRlQ+MDwvRFJBRlQ+PC9JdGVtPjwvT2JqZWN0PjxPYmplY3QgT2JqZWN0Q29kZT0iQ0RNX0VNQUlMIj48SXRlbT48T0JKRUNUQ09ERT48IVtDREFUQVtDRE1fRU1BSUxdXT48L09CSkVDVENPREU+PFBBUkVOVElEPi0zPC9QQVJFTlRJRD48SUQ+LTI8L0lEPjxQQVJFTlRDT0RFLz48RE9NT0JKRUNUQ09ERT48IVtDREFUQVtDRE1fRU1BSUxdXT48L0RPTU9CSkVDVENPREU+PENETV9FTUFJTF9QT1RFTlRJQUxEVVBMSUNBVEU+MDwvQ0RNX0VNQUlMX1BPVEVOVElBTERVUExJQ0FURT48Q0RNX0VNQUlMX1FVRVVFTkFNRT57SW5pdGlhbF9RdWV1ZV9OYW1lfTwvQ0RNX0VNQUlMX1FVRVVFTkFNRT57RXh0cmFBdHRyaWJ1dGVzfTwvSXRlbT48L09iamVjdD48L0F0dHJpYnV0ZXM+PC9DdXN0b21EYXRhPg==