An important mantra for any organization that wants to utilize its CRM effectively is: If it’s not recorded in the CRM, it didn’t happen!

All essential communications and customer emails must be recorded against the customer record for future reference. Being able to send an email from Salesforce and log it as an activity has been helpful for Salesforce users.

This was achieved by having the user directly email the contact from the contact record activity component Email Lightning Action button. Another option was to create a record-triggered flow where you had multiple steps:

1. Send the Email

2. Create an EmailMessage record with all the information from the Email

3. Create EmailMessageRelation to relate the Email to the record

With the thousands of requests on the IdeaExchange, Salesforce listened and built this feature into Flows in the Summer 23 release. In the example, we will create a Record Triggered flow when an opportunity is updated to Closed Won, and an email will be sent to the contact. In this flow, we will use the email action flow instead of the Send Email Alert, which is typically used.

Steps on how to use this feature:

Create Record Triggered Flow

  • Go to Setup and type Flow in the Quick Find box
  • Click New Flow
  • Choose Record-Triggered Flow and click Create
  • In the Object field, select Opportunity
  • In the Trigger the Flow When: choose A record is created or updated
  • In Condition Requirements, choose All Conditions Are Met (AND)
  • In the Field, choose StageName
  • In the Operator, choose Equals
  • In the Value, choose Closed Won
  • Where to Run the Flow for Updated Records: choose Only when a record is updated to meet the condition requirements.
  • Click “X” in the upper right corner
  • Click “+” to add new element
  • Type “email” in the QuickFind box
  • Click Send Email
  • Label your Element
  • In the Body field, click the toggle to include in Email
    • In the Body field, choose New Resource
    • Choose Text Template in Resource Type
    • Label your Text Template in API Name
    • In the Body next to the Resource Picker, choose View as Plain Text in the dropdown.
    • Paste the text into the body:

      Hello {!$Record.Opportunity_Contact__r.FirstName},

      Thank you for your purchase! You will receive a follow-up email with tracking information once the item has left our warehouse. If you have any additional questions, please feel free to contact us!
      XTIVIA
  • In the Log Email to Send toggle to include in Activity, select {!$GlobalConstant.True}
  • In the Recipient ID, select {!$Record.Opportunity_Contact__r.Id}
    (You will choose whatever field will pull the Contact ID of the individual you want to contact. For this example, we had a custom lookup field Opportunity_Contact__c)
  • In the Related Record ID toggle to include in Activity, select {!$Record.Id}
  • In the Subject, enter “Thank you for your Order!”
  • Save your flow and Activate.
Salesforce Flow: Create Triggered Flow

Test Your Flow

  • Go to any Opportunity record that does not have the Stage of Closed Won
  • Click Edit
  • In the Stage field, select Closed Won
  • You will now see an email logged in the Activity tab of your page layout:
Salesforce Flow: Test Your Flow

Let XTIVIA help you with our certified Salesforce experts. Don’t forget to ask us about our Salesforce Admin On-Demand service– contact us today!