top of page

Let's Deal with the To Address Dilemma (Or Why don't I see the correct To Address)

Writer's picture: Sean FieldingSean Fielding

Updated: Feb 11



Who was the original email recipient?
Who was the original email recipient?

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:


If your process(es) require the original recipient's email address, no problem. Email-to-Flow has you covered.


Leverage the Email-to-Flow Get Header Value apex action to identify the original recipient's email address.
Leverage the Email-to-Flow Get Header Value apex action to identify the original recipient's email address.

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.


Replace To Address equals Env_ToAddress with the header value returned by the apex action.
Replace To Address equals Env_ToAddress with the header value returned by the apex action.

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


Create a new custom field on the email message record and store the email service email address.
Create a new custom field on the email message record and store the email service email address.



Comments


bottom of page