Hi! I'm building a flow which in part takes images from a Microsoft Form and emails this to a mail list with the images embedded.
I've tried these test cases and found what works and what doesn't:
Jpg/jpeg -> Use base 64 formatting in HTML img element
Png -> use regular formatting and link of item in HTML img element
I've tried base 64 on the PNG files but it doesn't work. I've tried Using a test png taken online with the regular formatting and it worked. However, when using the sharepoint/onedrive link for the item from my Microsoft form, the embedding suddenly doesn't work.
I've already tried setting the folder to public, as well as accessing the direct PNG image's link in incognito mode without a Microsoft account logged in. I've also tried using an HTML sandbox online to test if the PNG image from my MS forms loads - and it does. It works everywhere EXCEPT the email body sent by my flow.
This is an apply to each structure which takes all images and attachments into account:
This is the code behind append to image elements array for png files (output is just the link of the image in onedrive)
This is a sample output of the "compile image embeds", which is an HTML component that combines all image embeds (separated by a <br>) and works in all other HTML sandboxes / IDEs:
output of the exact component in sandbox:
output of the exact component in email body:
Hi,
You may refer my blog, but it requires premium connector:
Method to embed an image in email body using Power Automate (manish-solanki.com)
It also works when size of image exceeds 1 MB & also works for both desktop/web outlook client & Gmail.
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.