About a year ago, I wrote an article on how you can use Flow to Mail Merge using Flow using a couple of SharePoint lists. This works great for sending the same email to all recipients or even structuring the email in different ways based on metadata captured in the Flow.
However, I have faced more and more scenarios, where Flows are created using a service account with elevated permissions that only a select number of users have access to, typically IT. The content of the email, however, may be set by someone else, such as a marketing or communications person. In this scenario, changing the email template would require contacting the IT person and requesting for specific changes to be made – not ideal.
In this article, I am discussing the concept of using tokens inside an email template to allow easy formatting without any access to the Flow itself.
Creating the Email Template
We begin again with the email template. In this example, we will create a template that has a few tokens incorporated in it. I will create my email template in HTML format, but that is not a strict requirement. Here’s my template
Welcome email
Hello ,
I have to say, your last name “” is very nice.
Not the best example, but I hope you get the point. I am storing this example in my email template list in SharePoint.
Building the Flow
The flow is composed of four steps
- Get the email template
- Get list of recipients
- Replace tokens with desired text
- Send the emails
Get the email template
Get list of recipients
Replace tokens with desired text
This action effectively looks up the token in my Email Template variable declared above and replaces it with the First Name of the user from the SharePoint list item.
Next, I proceed with replacing the token with the Last Name of the user from the SharePoint list item.
You’ll note that the second expression input is different. That is because the input for the second Compose action is in fact the output of the Replace First Name Compose action.
Send Email
Once the email is sent, I then reset the Email Template variable to what it originally was with the token place holders so that the next iteration can correctly replace them.
This approach works well, but there are two caveats to consider:
- if the tokens are incorrectly written, then they will not be updated in the email itself
- if you want to add additional tokens, then IT will need to add rules for parsing it and replacing it.
Keep it Flow-ing…





