Getting Started with Process Builder – Part 54 (Update the Case Status Through Email-to-Case Response)

Getting Started with Process Builder – Part 54 (Update the Case Status Through Email-to-Case Response)

Last Updated on December 16, 2020 by Rakesh Gupta

Big Idea or Enduring Question:

  • How can you automatically update the case status when receives a response from customers via Email-to-Case?


This blog post will help us to understand the following

  • Create a Process Builder which fires on customer’s response to an email-to-case 
  • Understand how email-to-case works 

Business Use Case

Pamela Kline is working as a System administrator at Universal Containers (UC). She has just implemented an email-to-case process. Now she has received the following enhancements from the support agent:

  1. Automatically add customer response to the case email thread, when the customer replies to the email that has been sent from a case.
  2. Re-open a case when the customer responds to a support agent email, within five days of case closure.

Automation Champion Approach (I-do):

Email-to-Case allows you to create a case automatically when a customer emails in. It also populates some key information, for example, the email subject becomes the case subject, and the email body-mapped to the description. You can configure multiple Email-to-Case channels based on your business use case.

Next, you have to understand the Thread ID. The thread ID is a unique ID generated for outbound emails within the case. The thread ID will look like ref:_00D90wAtk._500901Kc5WN:re. To automatically add customer response to the case email thread,  make sure that Email-to-Case has been configured correctly for customer email responses to be attached to the case.

  • Email Threading is an important part of Email-to-Case setup. Setting this up essentially means that, if a customer emails you more information about an existing Case, their second email will be attached to their existing Case instead of creating a new Case. If you want to auto add a unique Thread ID into your auto-responses and other outgoing emails, then navigate to Setup | Build | Customize | Cases | Email-to-Case and select the check-boxes as shown in the following screenshot

Insert Thread ID in the Email Subject and Body

  • When you are replying to a customer make sure to change the address from the Owner to the Email to the Case support address.  If this is not changed, then the response from the customer will be sent to the owner of the case and will not be added to the Email Thread. Follow the below steps to add Email-to-Case support address to from address (Basically we are going to add Email-to-Case support address to Organization-Wide Addresses:
  1. Copy the Email Services Address (i.e. Long email address) from Email-to-Case as shown in the preceding screenshot.
  2. The next step is to add a new Organization-Wide Email Addresses. Use Email Services Address (Long address) in place of  Email Address, as shown in the following screenshot:Organization-Wide Email Addresses
  3. For verification purposes, Salesforce will send an email notification with a confirmation link to the above-mentioned email address
  4. As we are using an Email-to-Case routing address, it will automatically create a case in your org, from where you can verify the ownership of the email address.Verify your Salesforce Organization-Wide Address
  5. Click on the link mentioned under the description to verify the Organization-Wide Address. After successful verification, you can use the Email-to-Case Support address to send out an email from Salesforce.

Email to Case support address

Sample Output:-

Email Thread

Solution for Use Case – 2

Our next task is to create a Process on the Email Message object to Launch a Flow, only when an email message is received. To create a Process on the Email Message object, follow the instructions below:

Step 1: Define Process Properties

  1. Click Setup.
  2. In the Quick Find box, type Process Builder.
  3. Select Process Builder, then click New.
  4. Name the Process and click the Tab button. The API Name will populate. 
  5. As a best practice, always input a description
  6. The process starts when A record changes.
  7. Click Save.

Step 2: Define Evaluation Criteria

  1. Click on the Add Object node to begin selecting the evaluation criteria.
  2. Select the Email Message object from the dropdown list.
  3. Start the process only when a record is created.
  4. Click Save.

Step 3: Define Process Criteria

  1. Click the Add Criteria node to begin defining the process criteria.
  2. Name the criteria.
  3. The criteria should execute actions when the conditions are met.
  4. Set Conditions
    1. Row 1
      1. Field: EmailMessage | Parent | Status
      2. Operator: Equals
      3. Type: Picklist
      4. Value: Closed
    2. Add Row
    3. Row 2
      1. Field: EmailMessage | Parent | Incoming
      2. Operator: Equals
      3. Type: Boolean
      4. Value: True
    4. Add Row
    5. Row 3
      1. Field: EmailMessage | Parent | Close Date
      2. Operator: Equals
      3. Type: Formula
      4. Value: [EmailMessage].CreatedDate -5
  5. Select All of the conditions are met (AND)
  6. Click Save.

Step 4: Add Action – Update Records

  1. Below Immediate Actions, click Add Action.
  2. For Action Type, select Update Records
  3. Name the action.
  4. Select the option Select a record related to the EmailMessage record type. 
    1. Select the EmailMessage | CaseID record type. 
  5. The criteria for updating records should be No criteria—just update the records!.
  6. Filter the records you update based on these conditions
    1. Row 1
      1. Field: Status
      2. Type: Picklist
      3. Value: Working
  7. Click Save.

In the end, Pamela’s Process will look like the following screenshot:

Almost there! Once everything looks good, click the Activate button. 

Formative Assessment:

I want to hear from you!  

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? 

Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

11 thoughts on “Getting Started with Process Builder – Part 54 (Update the Case Status Through Email-to-Case Response)

  1. Any suggestions so that when users originally CC’d on a case reply to a case a new Case does not get created? There does not seem to be a way to setup auto-response to also go to users that are CC’d so that they also get the thread id in the reply.

    1. Actually – I guess I now see the “Case Auto-Response Rules” settings. (I only find answers to problems right after posting.. even if after searching for long periods. ha) Will test to confirm…

  2. I am trying to follow the process builder steps but I don’t have [EmailMessage].Parent.Status and I need to indicate in the criteria that the case has to be closed to start the process. Is there another way to proceed?
    Thank you, the article is very clear and easy to follow 🙂

  3. This is a great use case! Is there a way to test this out in a Sandbox I wonder? I don’t know of a way to turn on temporary email delivery within the sandbox. Any suggestions would be appreciated.

    *Bailey Rudd * Sales Operations | CRM Administrator

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.