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 create & send HTML emails using rich text template in 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 in a Flow using custom HTML.
It helps companies automatically send branded, personalized, and user-friendly emails to customers.
Use Case to Send HTML Email Using Salesforce Flow
Recently, I received a requirement from the marketing manager 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 the flow should trigger when the stage is changed to ‘Closed Won‘. In the Configure Trigger, 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, then add the HTML content that contains the text and buttons 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, including the button and the email body text formatting.
<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 hardcode the email subject.
- 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 its body is not a typical one we 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 create & send HTML emails using rich text template in 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
- Fault Paths in Salesforce Flow

Shubham is a Certified Salesforce Developer with technical skills for Building applications using custom objects, approval processes, validation rule salesforce flows, and UI customization. He is proficient in writing Apex classes, triggers, controllers, Apex Batches, and bulk load APIs. I am also familiar with Visualforce Pages and Lighting Web Components. Read more | LinkedIn Profile