Send Email using Email Templates with Salesforce Flows

In this blog, we will learn how to send emails using email templates with salesforce flows.

Why to use Email Templates? 

  • We can create personalized Email templates by including object fields, improving the customer experience.
  • Whenever there are repetitive tasks, such as sending Welcome Emails to new customers, we can send emails using email templates with salesforce flows to increase productivity.
  • Using standardized templates for communication helps in maintaining uniformity.

Business Scenario: When the Case Status is updated to “Closed”, send an email to the contact using the corresponding email template.

Pre-requisite:

Create Email Template: Create a new Email Template and associate it with Case by selecting Related Entity Type as ‘Case’. Utilizing email templates within Salesforce flows streamlines the process of sending pre-defined responses to customers via email.Send Email using Email Templates with Salesforce flows

  • Create a custom field called “Resolution Comment” on the Case object for adding comments about specific cases.
  • Using the Insert merge field we can retrieve the Case Number and Case Resolution Comment of each case in the Email Template.

Send Email using Email Templates with Salesforce flows

To learn more about how to create an Email Template using Email Template Builder, click here

Support Settings: The Status field on the Case object doesn’t show a ‘Closed’ value in the picklist by default. To enable this go to Setup and search Support Settings.

Edit the Support settings, then mark the ‘Show Closed Statuses in Case Status field’ checkbox as Checked.

Send Email using Email Templates with Salesforce flows

 

Create Flow:

Let’s Start with creating Record Triggered Flow. The flow sends the Email when the Case Status updates to “Closed,” so the Object is Case, and the Trigger the flow condition is “A Record is Updated.”

Want to Learn Salesforce Flows? Checkout our Salesforce Flow Course

 

Send Email using Email Template with Salesforce Flows

 

As per the requirement, send the email only to the Contact of a Closed Case when the ContactId is not null.

Send Email using Email Template with Salesforce Flows

 

Get record Element: This element is used to retrieve Email Template Records with the Developer Name ‘Case_Closure_1695315211444’.

In order to fetch the Developer Name of your Email Template by using ID write Query in Query Editor as ‘SELECT id, name, DeveloperName FROM EmailTemplate WHERE id=’00X2t000000ckdjEAA’ in Developer console or Salesforce inspector plugin.

Query to Fetch Developer Name

Get Record Element

 

Get Record Element

 

Add Email Action: 

  • Email Template Id: To get Subject and Body from Email Template by using Id ie. {!Case_Closure_Email_Template.Id}
  • Log Email on Send: Set Log email on Send TRUE with {!$GlobalConstant.True}

Send Email using Email Templates with Salesforce flows

  • Recipient ID: Set the recipient ID as {!$Record.ContactId} when sending an Email to the respective case contact, ensuring accurate communication.
  • Related Record ID: In our scenario, the related record ID is the Case ID {!$Record.Id}

Email action

 

This is how our Flow looks in the End. Save and Activate the flow to get the results.

Flow

 

Now, update any existing Case record Status to ‘Closed’ and Add a Resolution Comment. You will receive an email as shown below.

Email Send using email Template

Things to consider while working with email templates:

  • Personalize emails keeping in context different client requirements
  • Test your email templates on different devices to ensure they display well across each device type.
  • Maintain a consistent tone and branding across all email templates.
  • Ensure all the attached resources in the email like links and merge fields are working as expected.

Furthermore, here are some business use cases for sending emails using Email Templates with Salesforce Flows:

  • Sending promotional Emails and newsletters to prospects to provide more information about the organization.
  • It helps to send invoices and payment reminders to Clients with required Transaction details.
  • Event invitations along with the registration link can be sent.
  • Recognizing employee’s work anniversaries, and birthdays and sending them custom-tailored emails.

For more details check out the video:

Get a complete Roadmap To Learn Salesforce Admin And Development 👇

Share Now

Similar Posts

2 thoughts on “Send Email using Email Templates with Salesforce Flows

Leave a Reply

Your email address will not be published. Required fields are marked *