Skip to main content

How to embed an image in an email | Power Automate

In this post let us how to embed an image in an email using Power Automate


In order to embed an image in an email - it would be easy if the image is stored in OneDrive or SharePoint folder and retrieve them.

Let us see how to accomplish this...
  • Create a folder in OneDrive for Business
  • Upload an image to embed in email
  • Now, let us create flow. Add a trigger
  • Add a variable (this helps us to form the image tag to embed in email)
  • Add OneDrive for Business connector and chose "List files in folder"
  • Add "Get file content" and File field add - "Id" from the above action
  • Now add "Get File Content" action from OneDrive for Business connector
  • Under File field - select "Id" from the dynamic content
  • Apply to each automatically applies when you add "Id" into File field.
  • Now add "Set Variable" and update it's Value as
<img src="data:image/png;base64,@{body('Get_file_content')?['$content']}" alt="Birthday Image" />

<img src="data:image/png;base64," alt=”My Image” /> is the tag to be used to create proper image. between 64, and " - go to dynamic content and add Content from the "Get File Content" action.

  • Now, add "Office 365 Outlook" connector and select "Send an email"
  • In the email body add the variable created above
Save and Test.

The same way - get list of attachments from SharePoint Library and get content and update the image tag with the details. Add the variable to the Email Body.

Comments