Set up an Email Rule
The Email Rule is where you tell e2a how to process your emails that are received. When an email is received, e2a can automatically create a new record, update an existing record, or simply attach the email to an existing record of the Target Object.
- Go to the e2a Email Rules tab
- Press the New button to create a new email rule
Setup and configure an e2a Email Rule as follows:
Rule Details
- Rule Name – give the rule a name (e.g., Email to Lead)
- Available Email Services – select the Email Service that you created. If you have not created any then please check the details in Set up an Email Service. If you want to create an Email Rule without email service, please leave this field blank.
Target Object Configuration
- Target Object – select the object that will be your Target Object for the emails to create records and/or update records and/or attach to
- Insert Record Type - select the record type to insert when a record is inserted in the target object
- Action if no Match Found - options determine the action taken when an email is received and no match is found in target object (e.g. email has no or unknown thread id)
- Insert New Record - enables new record to be inserted in target object for incoming email
- Put email in Unmatched Email Queue - disables new record to be inserted into target object and move email to selected unmatched email queue
- Drop Email - disables new record to be inserted into the target object and deletes incoming email
- Go to another e2a Email Rule - stops processing current e2a Email Rule and passes the email to the specified e2a Email Rule without making any change to the current target object
- Allow Manual Insert - specify whether you want e2a to be able to insert new records into the Target Object or not, once an email has landed to unmatched queue via 'Match' button on unmatched email detail page
- Allow Manual Match - specify whether you want e2a to be able to match new records into the Target Object or not, once an email has landed to unmatched queue via match button on unmatched email detail page
Select other Rule settings as required. See notes below for guidance in completing this page. All fields on this page contain help text. Be sure to read the help text if you are unsure of a field’s purpose or functionality.
Incoming Email Configuration
- Insert Thread Id in Email Subject and Insert Thread Id in Email Body settings allow you to specify whether you want thread Id to be automatically added in incoming email’s subject and/or body.
- Store Email Attachments option allows you to specify whether or not you want to store inbound email attachments to Target Object (such as Lead) or Email Storage Object (e2a emails) or both
- Store Attachments In* option allows email attachments to be stored in Attachment Object or Files, i.e., if you choose Attachment Object then it will appear in Notes and Attachments section of your Target Object and if you choose Files then it will appear in Files section of your Target Object
- Automatically Copy Tags option allows you to automatically copy tags to incoming email when conversational email is found
- Store a copy of email as an Activity option allows you to create an activity on target object when incoming email inserts or update a target object
*This setting does not apply on inline images. Inline images are always stored in Documents, both for incoming and outgoing emails
Alternate Thread Id
Alternative record matching option allows you to match inbound emails to existing records via Regex Pattern (specified in ‘Alternate Record ID: Match Regex Pattern’) to match data from subject/body/header of incoming email with the field specified in ‘Alternate Record ID: Field to Match’. Don’t want to use this option? You can leave it blank. To see the example usecases for Alternate Thread Id please follow this link.
Matching and Ownership Assignment
This section is used to assign the owner and/or unmatched queue based on data extracted from the email.
- Default Owner – set the default owner of any new record created. This could be a user or a queue.
- Default Unmatched Email Owner – set the owner of unmatched emails a 'Queue' in which unmatched emails should land OR choose a user as owner based on 'First User to Match via From or To Email Addresses'. You will see the queues listed that you created earlier for this purpose in an adjacent dropdown. The drop down will only list queues that support the e2a Unmatched Email object. Be sure that any queues you have setup for this purpose do support this object.
Note: Before e2a v3.4943, this field was named 'Default Unmatched Email Queue' and it used to let users choose only a 'queue' to serve as the owner of e2a unmatched email records. - Default Email Owner - set the default owner of new e2a email being created. This owner could be 'Email Service Address Context User' or 'First User to Match via From or To Email Addresses'.
Action Rules - Pre Process:
This setting (available in view mode of email rule) is called first, before attempting to match email to target object.
- Processing Order - Order in which this rule is processed with respect to other rules. Smaller number means earlier processing
- Trigger When - Trigger this rule when expression in 'Match Pattern' is matched or not
- Match Pattern - Specify the regular expression to be used for matching
- Search In - Email fields to search and match regular expressions in
- Action Type - Action to take when a match is found in any of specified Search In fields.
Actions are of following four types
- Set Owner of record - Set/Assign owner of new target object record
- Move email to Unmatched Queue - Move email to specified unmatched queue. If no queue is selected, default queue of email rule is used
- Go to another e2a Email Rule - Passes the email to the specified e2a Email Rule without making any change to the current target object
- Drop Email - disables new record to be inserted into the target object and deletes incoming email
- Stop Processing Further Rules - Specifies whether to process further action rules or not after processing current action rule.
Field Assignments
A number of rules can be defined in this section, and are executed in order.
The Field Assignments section allows you to map various email fields (such as subject, body, sender etc.) to fields of target object. You can provide unconditional, conditional or regular expression based mappings between email and target object fields.
Fixed mappings
- Unconditional mappings are applied when a record is created or updated if “overwrite allowed” option specified
- You can use predefined fixed mappings which are created on common fields of an email for your convenience
Field Assignment Rules
- Conditional, Pattern based mappings allow you to specify a regular expression to extract data from email subject, body (Text Only), body, headers, To field, From field, CC field and/or email attachments, and store in any field of target object.
Trigger Settings
You can choose from the 3 options for the rule to trigger.
- Only Create a new Record (Default)
- Only Update an existing record
- Can Create a new record and/or Update an existing record (combination of 1 and 2)
Trigger Types
It decides when you want to execute the Rule that is setup in the Field assignment Rule section.
Always: Every time rule will be executed that is setup in the Field assignment Rule section. (Default)
Pattern matched: Looks for the regular expression, if it is true then process further else it will stop here.
Pattern not Matched: Looks for the regular expression, if it is not found, then process further else it will stop here.
Assignment Types
1. Pattern Based Field Assignment
Pattern based mappings allow you to specify a regular expression to extract data from email subject, body (Text Only), body, headers, To field, From field, CC field and/or email attachments, and store in any field of target object.
- Patterns are defined using regular expressions
- We can store empty value in a field by using Apply Empty Result checkbox
- For Picklist field you can choose to store a Picklist Option instead of regular expression result string
- If result data doesn't fit/match the target field type then no action is taken (e.g. a result of 'abc' is not valid for 'Number' type field)
- Rule execution order is important; field pointed by multiple rules get value from last such rule
- Regex capturing group specifies which group to use from result of regular expression match
- If you use the pattern in the matching sections then the capturing group of the pattern should not be blank or 0. It should be one or greater than one
- You can overwrite values in a field of an existing record using the Allow overwrite checkbox
- Overwrite non-blank values - Gives you the privilege to overwrite an existing value in destination field
If you want to see common use cases of regex and learn more, please click here
2. Pattern Based Lookup Assignment
It allows you to lookup result of a regular expression in another object and store ID of found record on any lookup field of target object.
3. Fixed Value Assignment
It allows any field on the target object to be selected as destination. Field type is detected and it will fill the selected field with a fixed value that is given.
- Fixed Value Text
- Fixed Value Date
- Fixed Value Number
- Fixed Value Picklist
- Checkbox
- ID
4. Fixed Source (By Default)
It gives a dropdown to select the type of source value from all fixed email source fields, e.g. From Email Address, From First Name, Email Text Body, Email HTML Body and Headers etc. Value from any of these fields will be mapped on to the target object destination field that would be selected.
Append
It will append a value that is generated by the current rule after the old value with the separator given by the user.
Clone
You can create a clone of an existing email rule. It copies all the settings including Target Object, Field Assignment Rules, Action Rules and rest of the configuration from the existing email rule to the clone email rule except the Email Service.
To create a clone, please follow the steps below:
- Go to the e2a Email Rules tab
- Select any existing Email Rule and click Clone to make copy of the email rule
- Enter name for the clone email rule in the popup's Rule Name field and click Save
Please contact us at support@ortooapps.com for any questions.
★★★★★ - EXCELLENT
★★★★☆ - GOOD
★★★☆☆ - OK
★★☆☆☆ - POOR
★☆☆☆☆ - RUBBISH