Loading

Email Message Fields Are Not Evaluated by Email-to-Case Auto Response and Assignment Rules in Salesforce

Date de publication: Oct 13, 2022
Description

When using Email-to-Case in Salesforce, fields on the Email Message object appear as selectable criteria in Auto Response Rules, Case Assignment Rules, and Milestones. However, when an email triggers case creation via Email-to-Case, rules that use Email Message fields are skipped or evaluate to false in debug logs. This is working as designed (WAD) due to the timing of when the Email Message record is saved relative to when automation rules fire.

Résolution

This behavior is working as designed. Auto Response Rules, Assignment Rules, and Milestones run on the workflow engine, which pulls all fields related to the object in question as available criteria. Email Message appears in the list because it is related to Case via the Case Source field.


When Email-to-Case processes an incoming email, Salesforce first performs a database save on the Case object. At the time of the Case save, no Email Message record exists in the database yet. The Email Message record is saved later in the process. This means that when automation rules fire during the Case record save, no related Email Message record is found, so Email Message field criteria evaluate to false and the rule moves to the next entry.

Example Scenario

To reproduce this behavior:

  1. Ensure Email-to-Case is active.
  2. Create an Auto Response Rule with the following entries:
    1. Entry 1 Criteria: (Case: Created By EQUALS 'your default case creator for Email-to-Case') AND (Email Message: To Address EQUALS 'your Email-to-Case address') — select any email template.
    2. Entry 2 Criteria: (Case: Created By EQUALS 'your default case creator for Email-to-Case') — select a different, easily identifiable email template.
  3. Send an email to the Email-to-Case address.
  4. Notice that the second email template is sent, even though the Email Message record correctly shows your Email-to-Case address as the To Address. This confirms that the Email Message criteria in Entry 1 evaluated to false.

 

Workaround

For Assignment Rules, create a Salesforce Flow or Workflow Rule to automatically populate the owner field. This substitutes the Assignment Rule functionality and allows owners to be assigned to cases created via Email-to-Case.

Numéro d’article de la base de connaissances

000384019

 
Chargement
Salesforce Help | Article