Send HTML Emails Using Salesforce Flow : Bijay Kumar
by: Bijay Kumar
blow post content copied from SalesForce FAQs
click here to view original post
### Summary of Sending HTML Emails Using Salesforce Flow In Salesforce, we typically use classic or Lightning email templates for sending automated emails, but these templates have limited design capabilities. For more visually appealing and functional emails, HTML Email Templates are the solution. They allow the inclusion of colors, images, buttons, and personalized customer details, making emails more engaging. This article explains how to send HTML emails using Salesforce Flow without any coding. It provides a step-by-step guide to creating an HTML email template and a flow that automatically sends the email when a customer's opportunity status changes to 'Closed Won.' #### Key Steps to Create HTML Emails in Salesforce Flow: 1. **Setup Flow**: Navigate to Setup > Flows and create a new flow. 2. **Select Trigger**: Choose "Record Trigger Flow" and set the triggering object to Opportunity, with a condition for when the stage is 'Closed Won.' 3. **Create Email Body**: Use a Text Template to design the HTML email, incorporating elements like colors, buttons, and customer details. 4. **Send Email Action**: Add an action to send the email, specifying the subject, sender's email, recipient's email, and the body created in the previous step. 5. **Save and Activate**: Save the flow, debug it to ensure it works correctly, and then activate it. By following these steps, businesses can automate the sending of branded, personalized emails to customers, enhancing their communication and engagement. ### Additional Context HTML emails are crucial for businesses that want to maintain a professional appearance and provide a better user experience. They can significantly improve customer engagement by making emails visually appealing and informative. ### Hashtags for SEO #Salesforce #HTMLEmail #SalesforceFlow #EmailAutomation #CustomerEngagement #SalesforceTemplates #MarketingAutomation #EmailMarketing #CRM #BusinessCommunication
In Salesforce, we usually use classic or Lightning email templates to send automated emails. These work well for simple messages, but they can’t do much with design.
For example, when a customer buys something, we want to send a welcome email with their name, product details, and a link to get started.
An HTML Email Template helps us do this by adding colors, images, buttons, and customer details. It makes the email look nice and more useful.
In this article, we will learn how to send HTML emails using Salesforce Flow without any coding. I will provide a real-time example of creating an HTML template and explain how to create a flow and an HTML template step-by-step.
What is HTML Email in Salesforce?
In Salesforce, when we create a standard email, we can only add simple text and limited text formatting. An HTML email in Salesforce is a type of email that looks more like a web page than plain text.
It allows you to add colors, logos, images, buttons, and various fonts to make the email look attractive and professional. With HTML emails, you can also use merge fields to show the customer’s name, product details, or any Salesforce data inside the email.
In Salesforce, we can create HTML emails using Email Templates or build them directly inside a Flow using custom HTML code.
It helps companies send branded, personalized, and user-friendly emails to customers automatically.
Use Case:
Recently, I received a requirement from the marketing manager that they wanted to send a branded HTML welcome email to every new customer when the opportunity is marked as ‘closed won’.
Instead of manually sending these emails, the company uses a Salesforce record-triggered flow to automatically send a dynamic HTML email when the opportunity stage changes to ‘Closed Won’.
Send HTML Emails Using Salesforce Flow
Using the above scenario, we will create a flow and, within that, an HTML email template to automatically send an email to the customer.
Click on the Setup. -> Home Page. -> In Quick Find Box, Search for Flows. You will see an option under Process Automation. -> Click on Flows.
Click on the New Flow button, then select “Start From Scratch.” We want to create a flow for sending an HTML email on record creation or update, so we need to choose the “Record Trigger Flow.“ Then, click on the Create button.
In the start element, we have to select the triggering object. In our scenario, Opportunity is a triggering object because when the stage is changed to ‘Closed Won‘, the flow should trigger. In the Configure Trigger, we need to select ‘A record is created or updated‘.

I also added one condition: the Stage field should Equal Closed Won.
Then, I selected “Actions and Related Records” in the “Optimize the Flow” option.

After that, we need to create the email body. Here, we are creating the HTML email that helps us achieve this by adding colors, images, buttons, and customer details, making the email look nice and more useful.
To do this, click New Resource. In the Resource Type, select Text Template. Provide the API Name. Then, in the Body, first select View as Plain Text and add the HTML content, which will contain the text and buttons that you want to send with the email.

Then, change View as Plain Text to View as Rich Text, and you will see the email body is formatted with color buttons and other formatting. After that, click on the Done button.

Below, I have provided the HTML content, which includes the button and the text formatting for the email body text.
<h2 style="color:#2E86C1;">Hello {!$Record.Account.Name},</h2>
<p>Your opportunity stage has changed from <strong>{!$Record__Prior.StageName}</strong> to <strong>{!$Record.StageName}</strong>.</p>
<p>Thanks for purchasing <strong>{!$Record.Name}</strong>. We're excited to have you on board!</p>
<p>Your Account Manager is <strong>{!$Record.Owner.Name}</strong>. If you have any questions, feel free to reach out to them at <a href="mailto:{!$Record.Owner.Email}">{!$Record.Owner.Email}</a>.</p>
<p>Click the button below to start your onboarding process:</p>
<p>
<a href="https://abcsoftware.com/start" style="background-color: #28a745; color: #fff; padding: 10px 20px; text-decoration: none; border-radius: 5px;">
Start Onboarding
</a>
</p>
<p style="font-size: 12px; color: #888;">Thank you for choosing us!<br/>— The ABC Software Team</p>
Now we need to add a Send Email Action element to send an email after the record is created or updated. As you add the email action element, you need to provide the Label, and the API Name will automatically populate.
The Description is optional; you can provide a brief introduction to this action element.
Then we need to Set Input Values for the Selected Action. Below, I have provided the fields:
- Subject: Here we can provide a hardcoded value as the subject of the email.
- Rich-Text Formatted Body: Since we are using HTML email and have selected ‘View as Rich Text’ in the text template, we need to set this value to true.
- Sender Email Address: Select the sender’s email address. Here, I have selected the Current User email.
- Recipient Address List: Here, we want to send an email to the opportunity, and we stored the email in the account object. For that, select $Record -> Opportunity -> Account -> Email.
- Body: Here, we need to select the text template that we created, which includes the HTML email template.

Now we are ready to save the flow. For that, click the Save button, provide the flow Label, and the API Name will be automatically populated.
After that, always debug the flow before activating it to ensure that the working flow is correct and that there are no runtime errors. Then activate the flow.
Now, navigate to the opportunity object and open any opportunity that is not in the Closed Won stage.
I am updating this opportunity record, changing the Stage to Closed Won, and saving the record. Now, the flow should send the email to the email address associated with this opportunity account.

As I update the record, I received an email with the information, and you can see that the email body is not a normal one that we typically see in classic or Lightning email.
In the HTML email, we can design the email according to our requirements, adding images, colors, text formatting, and more.

In this way, we can utilize the HTML email feature in Salesforce Flow to send a pre-designed email.
Conclusion
I hope you have an idea about how to send HTML emails using a Salesforce Flow. I have explained the process using a real-time example of creating an HTML template, step-by-step, and demonstrated how to create a flow and an HTML template that helps us achieve this by adding colors, images, buttons, and customer details, making the email look nice and more useful.
You may like to read:
- Transform Element in Salesforce Flow
- Count Records in Collection Using Salesforce Flow
- Use HTTP Callout In Salesforce Flow
The post Send HTML Emails Using Salesforce Flow appeared first on SalesForce FAQs.
June 12, 2025 at 07:29PM
Click here for more details...
=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Post a Comment