Salesforce Flow is a powerful automation tool that allows users to create custom processes in Salesforce. Among its versatile capabilities, Salesforce Flow actively enables users to send emails, making it one of the most common and impactful actions in the platform. Users can effortlessly send personalized emails by leveraging the platform's intuitive features and seamless integration with email templates and Salesforce data. This enables effective communication with customers, prospects, and stakeholders, ultimately driving business success. Here are different ways of sending emails from flow.
1- Using an Email Alert
Email alert is an email notification that Salesforce sends to specific recipients when a particular event happens in the system. In order to create an email alert, you have to create an email template first. Then in the email alert, you have to select the related object, email template, recipients, and the from email address.
In order to use an existing email alert in your flow, add the 'Send Email Alert' action or search for the name of the email alert.
Then, all you need to do is to provide the record Id. If the email alert is using merge fields, this record will be the starting point for those merge fields.
Since all the information (subject, body, recipients, sender) will come from the email alert, there is nothing else you need to do in the flow.
2- Using the Send Email Core Action
The second way of sending emails is using the 'Send Email' core action.
Add an action element to your flow and search for 'Send Email'. Then set input values for the action.
There are two options available in this action. First option is to compose an email directly in the flow. The second option is to use an existing email template.
- Body: This is the body of the email. It is required if you are not using an email template. It is possible to type a text or create a text template (rich or plain text) and provide it as a resource.
- Email Template ID: This is the Id of the Classic or Lightning email template to use for the email subject and body.
- Log Email on Send: It is a boolean that indicates whether to log the email on the specified records’ activity timelines and activity history. To log an email, you must specify a value for Recipient Id, Related Record Id, or both.
- Recipient Address Collection: This is a text collection of the recipients' email addresses. It is possible to enter a value for Recipient Id, Recipient Address List, and Recipient Address Collection as long as the total number of email addresses is five or fewer.
- Recipient Address List: This is a comma-delimited list of the recipients' email addresses.
- Recipient ID: This is the Id of a lead, contact, or person account record. You must provide a value if you are using an Email Template. If Log Email on Send is true, this parameter becomes the Id of the person to send and log the email to. If there is an Email Template Id, this parameter is the Id of the person to send an email to and populate recipient merge fields with. If you enter a Lead Id, you can’t use Related Record Id.
- Related Record ID: This is the Id of a non-recipient record. For example, the Id of an opportunity record. If there is an email template, this parameter is the Id of the record for populating email template merge fields.
- Rich-Text-Formatted Body: This is a boolean that indicates whether you want the resource specified for the Body parameter to use rich text.
- Sender Email Address: It is the organization-wide email address for sending the email. It is required when Sender Type is OrgWideEmailAddress.
- Sender Type: Type of sender that the email is sent from. Valid values are CurrentUser (default value), DefaultWorkflowUser, and OrgWideEmailAddress.
- Subject: It is the subject of the email and it is required if you are not using an email template.
Let's compose an email directly in the flow.
Create a text template to use as the email body.
Then set input values for the action. Pay attention that since the email body is a rich text, you have to make Rich-Text-Formatted Body true. In this example, the system sends the email from an organization wide email address.
Now, let's send an email using the email template from the first example.
Add a Get Records element to get the email template.
Then, add the Send Email action and set the input values. Body, subject, and rich-text-formatted body values are not relevant because they will come from the email template.
As you can see, there is an email log on the record. Moreover, it is possible to track email opens.
3- Using Custom Actions
Those were the standard ways of sending emails from flow. The 3rd way is using custom actions. Although the standard options are enough for most of the use cases, there are still missing options. For instance, it is not possible to send attachments. However, you can solve this issue using custom flow actions.
Here is a custom flow action called Send Better Email from UnofficialSF.
This action allows you to send attachments using content document link records.
Moreover, as you can see, it creates an email log and it is possible to track email opens.
Which Option Should I Choose?
There are multiple ways of sending emails in flow. Which option to choose depends on what you want to do. First of all, if you want to send attachments, you cannot use the standard options. Therefore, custom flow action is the only option.
If you want to use flow variables and compose an email directly in the flow, or you need full control on the recipients, then you should use the send email action. However, if you just need to trigger an existing email alert, then using Email Alerts would be the best option.