5 Easiest Ways to Embed an Image into an Email in Power Automate

In my recent Power Automate project, I needed to embed an image directly into an email. After some research, I found that using HTML image tags within Power Automate can do this.

In this tutorial, I will discuss the five easiest ways to embed an image into an email in Power Automate: Content ID (CID) Embedding, Data URI Embedding, Full URL Path, and Base64 Encoding.

Embedding an Image Using the Content ID (CID) Method in Power Automate

Imagine you are sending a marketing email from Power Automate, and you want your company logo to appear directly in the email’s body rather than as an attachment or link. The Content ID (CID) method is perfect for this. It allows you to attach the image to the email with a special identifier (the “CID”) to display inline as part of the email content.

For this example, I created a SharePoint document library called Embed Images and added our company logo to it.

How to embed images in Power Automate emails

Now follow the steps below:

1. Create an Instant cloud flow, provide a name for the flow, and select the trigger (Manually trigger a flow). Next, add the Get file content using path action to retrieve the company logo. Set the Site Address to where the image is stored, then specify the File Path and select the image.

How to embed an image into an email with Power Automate

2. Next, add a compose action and provide the following HTML:

<img src='cid:Tsinfo logo.jpg' />
Inserting Image into Email Body with Power Automate

3. Lastly, add a Send an email action and provide parameters below:

  • To: Provide the recipient’s email address.
  • Subject: Enter a subject line for the email.
  • Body: Use the output of the Compose action.

Then, click Show all to access the advanced parameters.

  • Attachments: For the attachment, set the name to something like “Tsinfo logo” and use the dynamic content from File Content as the attachment content.
Adding an Image into an Email - Power Automate

Now, we test our flow to do this. Click on Test Select Manually -> Click on Test inside the Test Flow tab. After the flow runs successfully, check the outlook you see, like the screenshot below.

Embedding an Image Using the Content ID (CID) Method in Power Automate

Embed an Image in an Email Using the dataUri Approach in Power Automate

Let’s say you’re sending an email from Power Automate and want to embed an image directly without adding any attachments or external links. The Data URI Approach is a great solution because it allows you to encode your image into a string format (Base64) and embed that string directly into your email.

Create an instant cloud flow, and then retrieve the image file from a location like SharePoint, OneDrive, or another source. The “Get file content” or “Get file content using path” action is used to fetch the image file. For this example, my image is present in onedrive, so I use the ” Get file content using path” action from onedrive, then select the image.

How to embed an image into an email in Power Automate

Then add a compose action and provide the following:

<img src="@{dataUri(body('Get_file_content_using_path'))}">
Send embedded image in email using Power Automate

Next, add a Send an email action and provide the parameters below:

  • To: Provide the recipient’s email address.
  • Subject: Enter a subject line for the email.
  • Body: Use the output of the Compose action.
Send embedded image in email in Power Automate

To test our flow, click Test, select Manually, and then Test inside the Test Flow tab. After the flow runs successfully, check your Outlook inbox. As the screenshot shows, you should see the email embedding an image.

Embedding an Image in Email Using the dataUri Approach in Power Automate

Embed an Image in an Email Using a Full URL Path in Power Automate

Imagine you’re sending a monthly newsletter and want to include a banner image stored in a SharePoint document library.

Embedding an Image in Email Using Full URL Path in Power Automate

Using the Full URL Path method, we can get the image’s URL from SharePoint and include it in your email’s HTML body. To do this, follow the steps below:

Add a Get file metadata using path action in an instant cloud flow and provide the Site Address and File Path.

Power Automate Embedding an Image in Email Using Full URL Path

Then, adda send an email action and provide the following parameters:

  • To: Provide the recipient’s email address.
  • Subject: Enter a subject line for the email.
  • Body: Provide the below HTML code:
<img src="Your Site Address@{outputs('Get_file_metadata_using_path')?['body/Path']}">
How to Send an Email with Embedded Image in Power Automate

To test our flow, click Test, select Manually, and then Test inside the Test Flow tab. After the flow runs successfully, check your Outlook inbox. As the screenshot shows, you should see the email embedding an image.

How to Embed an Image to an email in Power Automate

Embed Image into an Email Using Base64 Encoding in Power Automate

Let’s say you’re sending an email with an image stored in a SharePoint library. Instead of linking to or attaching the image, you embed it directly in the email body using Base64 encoding.

Add a Get file content action in an instant cloud flow and provide the Site Address and File Identifier.

Embedding Image into the Email Using Base64 Encoding in Power Automate

Then, add a send an email action and provide the following parameters:

  • To: Provide the recipient’s email address.
  • Subject: Enter a subject line for the email.
  • Body: Provide the HTML code below with the expression:
<img src="data:@{body('Get_file_content')?['$content-type']};base64,@{body('Get_file_content')?['$content']}">
How to Embed an Image in Emails from Power Automate

Now, it’s time to save the flow. Click on Test -> Select Manually. After the flow runs successfully, check your Outlook inbox.

How to Embed Image in Power Automate Email

Embed Image into an Email Using HTTP Request in Power Automate

Now, I will show you how to send an email using an http request. In that email, I need to embed the image.

To do this, follow the steps below:

1. Create an Instant cloud flow, provide the flow name, and choose the flow trigger (manually trigger a flow).

Embed images in emails from Power Automate

2. Add the Get file metadata using path action and provide the site address and file path.

Power Automate Embed an image in an email

3. Add Send an HTTP request to SharePoint action with the following parameters:

  • Site Address: Select your SharePoint site address
  • Method: Select POST from the drop-down
  • Uri: Put the below send email endpoint code:
_api/SP.Utilities.Utility.SendEmail
  • Headers:
    • Accept: application/json;odata=nometadata
  • Body: Provide below:
{
'properties':
{
'To':['[email protected]'],
'Subject':'Embed Images in Emails',
'Body': '
<img src ="Site Address/@{outputs('Get_file_metadata_using_path')?['body/Path']}" >
'
}
}
How to embed an image in an email in Power Automate

Now, it’s time to save the flow. Click on Test -> Select Manually. When the flow runs successfully, it will send an email notification when you see the embedded image.

Power Automate Embed Image into an Email Using HTTP Request

In this tutorial, I covered five ways to embed images directly into an email using Power Automate. We looked at the Content ID (CID) method, the Data URI embedding approach, using a Full URL Path, Base64 encoding, and using an HTTP request. Each method allows you to display images inline within your email, whether the image is stored in SharePoint, OneDrive, or another location.

Additionally, you may like some more Power Automate tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…