Sending a beautifully formatted email from Power Automate (Flow)

updated March 10, 2020

I recently shared a winning use case for Office 365. Within this use case, I am using a flow in Power Automate to send beautifully formatted emails to our users. Something like:

formatted email from microsoft flow

Okay, maybe it’s not that beautiful, but it is colorful, has an image, and pops in comparison to black and white text only emails.

Using the Rich Text Editor in the Email Action

The Send Email actions include a rich text editor already, allows you to bold text, add some color, and format the email much like you can in Outlook.

rich text editor in flow action

That may suffice for your needs, but sometimes we need to send a fully formatted email, like my example above. That example wouldn’t be possible using the rich text editor approach. So let’s work around it and get this beautiful email sent!

Check out Outlook’s other sending email options here.

Power Automate sends formatted emails with ease

Inside the rich text editor, note the </> button. That button allows you to create exactly the email you want. Any HTML you want to put in there you can.

As long as you know HTML, you can send beautiful emails. DONE!

What if I don’t know HTML?

I know HTML but I didn’t want to write the HTML for this email. Call me lazy, or too busy, or just intuitive :D. Instead, here’s what I did, and what I suggest to you.

Create a new email in Outlook.

Style the email: add colors, content placeholders, images, tables, etc. For content placeholders, put something obvious like %%FULLNAME%%, %%LINK TO SOMETHING%%, %%MESSAGE%%, etc. Whatever data you expect the Flow to load for you. Something to make the text pop out to your eyes later on.

Email yourself the email.

Open the email you just sent to yourself in Outlook. Open it in a new window, not in the preview pane in your Inbox. Go to Message tab, then More Move Actions > Other Actions > View Source. It’s kind of hidden:

view source of email.png

Don’t be scared! If you don’t know HTML, the resulting action of clicking above might have your eyes hurting. That’s OK!

You should see something like this:html source of email.png

Look for your content placeholders, I see mine, %%FULL NAME%%, right about halfway down. What’s all that other stuff on the page? HTML! Don’t worry about it.

NOTE make sure to start with <html and end with </html>. You may get other message header details in there, ignore that, just copy what’s between <html... </html>

Click the </> button in the rich text editor and paste in this content.

Now replace your content placeholders with dynamic values from Flow!

That’s it

Images are tricky

A quick note on images. Outlook takes the image you included in your email and converts it to a string, to plain text. I found copy/pasting this didn’t work in Flow. I think the text ends up being too long in this action and it breaks.

Instead, what you should do is upload the image to the cloud. I used our marketing system Pardot, but you could upload it to a Google Drive, OneDrive for Business, a blog site, anywhere. Get the anonymous visitor URL to the image itself, and swap that out for the image.

Look for <image src=”ab2md3m… in the HTML and change the value of the src property to the URL of the image. Your src should look like <image src=”https://url/to/your/image.png&#8221; />.

Check out this YouTube video for using an image from a SharePoint library: https://www.youtube.com/watch?v=sZjZyBVhPIc.

That’s it!

I hope this little trick works for you. Alternatively, you could find a WYSIWYG editor somewhere and format your email and then copy/paste that HTML as well. I find, that since the email was made in Outlook, its source is very Outlook friendly.

60 thoughts on “Sending a beautifully formatted email from Power Automate (Flow)

Add yours

  1. Your training is not clear at all ! It is not clear where to copy from and where the copy should end. You did not give any example, you did not show the entire HTML code from Outlook, then you did not show what you copied exactly from that code.
    You wrote: …just copy what’s between <html… – entire HTML code is between these 2 tags, Sir ! It does not work ! Toggle code view button is not usable on the screen shots you attached, therefore the code does not work for you, too !

    1. Sorry to hear that! You’ll see many folks have been successful with this. However, Flow has changed recently, and these steps/screenshots will be dated.

  2. I have been using this trick for a while to make formatted emails. However, I find this doesn’t work with the “new” Outlook nor with Outlook 365. I’ve tried a number of converters, but so far everything looses the formatting. Any suggestions for a workaround if you can’t get the source from Outlook?

  3. Thanks so much, I was playing around with “Get File” and then HTML, Create Table…..it was just go on and on. Then I come across your instructions and it did exactly what I wanted and was so much easier.

  4. Whoa. I’ve put up with the basic formatting in Power Automate, but this just changed all my games. It worked perfectly! THANK YOU!

  5. Hi, thanks for this information. Really helpful. But when I try this I get the “Reply” and “Forward” buttons in the mail (O365 mailbox):
    Is there a way to hide the “Reply” and “Forward” buttons?

    1. I can’t see what you shared for an image, but I suspect you’re seeing the Reply and Forward buttons in the content area of the email. If that’s the case, you’ll need to edit the HTML some to remove those.

  6. I had to leave a comment – This is so simple yet so ingenious and annoyed with myself for not thinking of it sooner :)

    Thank you, David – Really useful tip!

  7. Incredibly helpful and just saved me who knows how many hours trying to figure out html. Thank you for writing this article!

  8. Good Informative blog and helpful one. Have something similar to this wherein I would need to apply some color formatting dynamically. That is, for a specific field value, the text color should be green else the default one. Appreciate your thoughts and input on this.

    Thank you.

    1. might need more info, and to be honest, I haven’t been in PowerApps in quite some time. I do remember doing some color switching and it should be simple with a conditional statement

  9. Great tip! I tried to include an image (sourced from a SharePoint asset library, but could not get the image to be visible. The image HTML was a bit more complex than I am used to, and I didn’t know what I should replace. Otherwise for me I loved the article. Thank you!

  10. Hi,
    this is great method, I’m using it a lot, thanks!!!
    is there also such an easy way to produce formatted mail in PowerApps, asking specifically on conditional formatting(red, yellow, green) according to specific value

    will appreciate your response.

    Eyal p

Leave a Reply

Up ↑

Discover more from David Lozzi

Subscribe now to keep reading and get access to the full archive.

Continue reading