How to Create an Email Template In Salesforce Flow

In Salesforce, when we need to send an email to the users to notify them of something or any update, we can create a pre-defined layout that may already include content, fields, or text.

In this Salesforce tutorial, we will learn about creating an email template in Salesforce Flow. We will first understand what an email template is and why we use it, then see how to create an email template in Salesforce Flow with a scenario and explanation.

Email Template In Salesforce Flow

What is an email template in Salesforce Flow?

An email template is a pre-defined layout that may already include content, fields, or text. Rather than creating a new email body every time, we have an option to use the email templates. In Salesforce, an email template is the easiest way to send an email.

Why do we use an email template in Salesforce?

  • The email templates are pre-written text messages that we can use for updating or notifying the customer.
  • An email template can save time, improve consistency, and enhance productivity. It helps us create and send quick emails to users.
  • It also helps to include merge fields from Salesforce records like all standard and custom objects.

While working as a Salesforce Admin for a US-based Organization that provides software solutions, I was assigned the task of sending an email to notify all active employees about the group discussion meeting.

Now, here’s the challenge: we have to send emails to all employees. This process of sending emails can be done manually, but it will be very time-consuming to do so; in that situation, it is better to use an email template in Salesforce Flow to automate this process.

See also  How to Call a Flow From Button in Salesforce | How to Launch Flow From Button in Salesforce

How to Create an Email Template In Salesforce Flow

We can create an email template in the salesforce flow using the above scenario and the following steps.

1. Log in to the Salesforce Org. -> Click on the Setup. -> Home Tab. -> In Quick Find Box, Search for Flows. You will see an option under Process Automation. -> Click on Flows.

Email Template in Salesforce Flow

2. Click on the New Flow button to create a new flow.

Email Template in the Salesforce Flow

3. We want to create a flow for creating an email template, so we have to select the Schedule-Trigger flow. Then, click on the Create button.

An Email Template in Salesforce Flow

4. Now select the Start Date and Time. From the selected date and time, the flow will start to execute. The Frequency is set to Daily because we want to execute this task on a daily basis. The Once is used when we want to execute this flow only once.

Then, select the object on which you want to create flow. As per our scenario, we have to send emails to all Active employees. For that, we have to add condition criteria, which are entry criteria IF Active_c Equals Yes.

Create Email Template in Salesforce Flow

5. You can see the flow chart displayed with the selected option in the above steps. Now, we need to create an Email Template for notifying employees.

To create a formula, click the Manager Tool and select New Resource.

Create Email Template in the Salesforce Flow

6. Then, you will see the New Resource window, in which you enter the necessary information. We want to create an email template for that select Resource Type as Text Template.

The API Name will automatically populate as we click the text box. The Description is optional.

Create an Email Template in Salesforce Flow example

7. Then, we need to enter the content of the Email Body, which is the message layout we want to send in the email. As we want to send emails to many employees, we can use Resource Picker to add any field in the email body. Then click on the Done button.

An Email Template in Salesforce Lightning Flow

8. Then, you can see the Text Template that we have created under the Resources. We need to add this template to an email to create an action. Click on the + plus icon and click on the Action element.

How to Create an Email Template in Salesforce Flow

9. As you click on the Action element, then you have to select the Email option from the Category. After that, In the Action field, you have to select Send Email. You need to enter the following details. We need to set the Label, and the API name will populate automatically.

How to Create Email Template in Salesforce Flow

10. Now, we need to set input values for the selected action to add an email body. To do so, click on the Include button, click on the body textbox, and select the Text Template that we created in the above steps.

How to Create Email Template in the Salesforce Flow

11. We will enter the values that we need to send an email. Enter the input values for the selected action as follows:

  • Body: We have selected a body from a resource that we have created already.
  • Subject: In the Subject action, we can manually enter the value for an email subject.
  • Sender Email Address: We can manually enter an email, and if we don’t enter an email, it will not give any error because if we don’t select a sender email, it will take the email address of the user who created that record.
  • Recipients Address List: Here, we have to send an email to every employee, and if there is an email field in the account record, we can select that field as an employee email.
See also  Two Ways to Post to Chatter Using Salesforce Flow

After that, click on the Done button.

Create an Email Template in Salesforce Flow

12. After setting up all labels and conditions, click the Save button to save the flow. For that, we need to enter the Flow Label; here, I have entered the Email Template. The API Name will automatically populate as we click the text box. The Description is optional; we can introduce our flow Shortly.

What is Email Template in Salesforce Flows

13. It is best practice in the flow to always Debug the flow before activating it, and then, if no error occurs, Activate the flow.

What is Email Template in Salesforce Flow

14. Here, you can see I received an email with the same subject and email template that we created.

Email Template in Salesforce Flow example

This is how we can create an email template in Salesforce Flow and use it to send emails.

Conclusion

I hope you have an idea about creating an email template in Salesforce Flow. We have seen what an email template is and why we use it, and then we have seen create an email template in Salesforce Flow with a scenario and explanation.

You may like to read: