How to Fill an HTML Email Template in Power Automate

Cloudmersive
4 min readOct 1, 2024

--

When we think about which applications to use for customizing and sending out HTML template marketing emails, Power Automate probably isn’t the first option that comes to mind.

It does, however, offer a variety of noteworthy advantages. We can heavily personalize the emails we send from Power Automate, and we can dynamically incorporate documents and other data from our system as email attachments. We can seamlessly connect our email-focused flows with other 365 services and/or supported CRMs.

We can also retrieve HTML strings from HTML template documents directly, modify placeholders in those strings, and place the resulting HTML directly into our Outlook email message bodies. Altogether, we have a promising email marketing tool at our disposal.

Walkthrough

In this Power Automate walkthrough, we’ll learn how to fill placeholder values in an HTML email marketing template and place the resulting HTML in an Outlook email message body. We’ll use the Cloudmersive File Processing connector to modify our HTML template string.

Below, we can take a look at the example HTML email marketing template I’ll be using in this walkthrough.

We’ll start by creating a manually triggered, instant cloud flow. We’ll use the manually triggered option for now so we can test our flow with full control over our data.

Before we add any new actions to our flow, we’ll open our manual trigger step and create a text input. I’m creating a text input “Recipient Name”; the value I eventually enter here will replace the [Name] placeholder value in my example template.

Next, we’ll add a Get file content action to retrieve our HTML template document. This action is available for the OneDrive, SharePoint, and OneDrive for Business connectors.

We’ll now add another new action, and this time, we’ll search for “Cloudmersive” connectors. This search will bring up a list of several Cloudmersive connectors; we’re looking for the File Processing connector with the purple logo.

Next, we’ll click “See more” to view the actions list, and from here, we’ll search for a connector action titled Replace a string in text with another string value.

After we select this action, we’ll need to create our connection with a Cloudmersive API key. We can get a free Cloudmersive API key by creating a free account on the Cloudmersive website (this allows a limit of 800 API calls per month with zero commitments).

To configure our request, we’ll first click “Show all” to view the advanced parameters, and we’ll then fill the Request/TextContent parameter with our HTML template content.

Right after that, we’ll enter our template placeholder string in the Replace/TargetString parameter, and finally, we’ll enter our manual trigger data into the Request/ReplaceWithString parameter.

As a quick aside — if we want to replace multiple placeholder strings in a single template, we can add another iteration of this action to our flow and pass HTML response content from the first iteration to the second.

In the final step of our flow, we’ll place our modified HTML content in the body of an Outlook email and send it to ourselves. I’ll be using the Outlook Send an email (V2) action.

Now we’ll save and test our flow. At this point, we’ll need to enter an example value in our “Recipient Name” input.

After our flow finishes running, we’ll find our customized HTML marketing email in our inbox.

Now that we understand the basic workflow, we can easily extrapolate this into a more complex automated flow that pulls other data from around our system.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet