/
Highlight Emails sent from Salesforce

Highlight Emails sent from Salesforce

Each time an email is sent via Salesforce to a Visitor-related Lead or Contact, record a highlight event.

Basic Flow

  1. Create a record-triggered Flow on the EmailMessage object.

  2. Add a Get Records element to load all related EmailMessageRelation records.

  1. Add a Loop element to iterate the EmailMessageRelation records. Inside the loop:

    1. (Optional) Add a Decision element to check any conditions. For example, test that the RelationObjectType is Lead.

    2. Add a Record Visitor Highlight action. Configure it for an Event Type of “EMAIL” and set the Record Id from the EmailMessageRelation.RelationId field.

  2. Save and activate the Flow. Each time an email is sent to a Lead that relates to an identified Visitor, a highlight event will be created.

Event Detail

To add relevant information to the highlight event, populate the Event Data property of the Record Visitor Highlight action. This is a collection of Apex-defined GenericFlowData objects - the Personalization Flow example demonstrates how these can be assigned using Flow variables.

Following the email use-case above, this would be a good place to record the subject and any other brief context data about the message. The data will then appear in the Event Detail column in the visitor highlight output.