
When leveraging Email-to-Case, a custom apex email service, or Email-to-Flow, customers do not send emails directly to the Salesforce email service email address. Instead, email forwarding on the email system links an easy to read email address to the Salesforce email service email address.
For example, a customer sends an email to support@mycompany.com. The email server then forwards that email to support@longsetofcharactersandnumbers@salesforce.com. This functionality, however, introduces one annoying issue.
Let's take a look at an example:
A customer (customer@thecustomer.com) sends and email to support@mycompany.com.
support@mycompany.com is hosted by Gmail.
support@mycompany.com has a forwarding rule to forward the email to support@longsetofcharactersandnumbers@salesforce.com.
support@longsetofcharactersandnumbers@salesforce.com is an email service that accepts and processes the email to create a case.
When you review the result case record, the email address information is not what was expected.
The From Address accurately reflects the original sender's email address (customer@thecustomer.com).
The To Address, however, is set to support@longsetofcharactersandnumbers@salesforce.com.
If your process(es) require the original recipient's email address, no problem. Email-to-Flow has you covered.

Introducing the Email-to-Flow Get Header Value apex action. With this apex action, we can inspect and retrieve the original recipient email from the email header data. We do this by simply instructing the apex action to return the "Deliver-To" email header variable.
With the original recipient's email address in hand, the value can be used to properly set the value on the resulting email message record.

Event better, create a new custom field on the email message record to store the email service that was leveraged.

Comments