How to Upload Image So I Can Include It in My Out of Office Message Gmail

This mail service explains how to embed images inside an email sent from a Ability Automate flow. This is a common requirement and can cause frustration depending on the requirements.

Generally, people desire to include images stored within SharePoint, and this will be the basis of this blog post.

At that place are a few different methods, and I volition explicate the differences as nosotros go through the postal service. If you adopt, hither is a video explanation:

The file I am going to utilize for my test is in a SharePoint certificate library, it is chosen powerAutomateTestImage.png:

Image used in Power Automate Flow to test embedding an image

The full link to the file is:

            https://accendo1.sharepoint.com/sites/PowerAutomateText/Images1/powerAutomateTestImage.png          

This scenario is elementary. On a client that is signed in to Part 365, y'all can specify the URL of the epitome in SharePoint and it should show in the email customer:

Power Automate Flow showing the most basic method to embed an image into an emal

This works well in the Outlook Spider web client, but not in other clients as the file is not reachable. And so unless all of your clients are using Outlook on the Spider web, I do not recommend this method.

Embed the paradigm content directly into the e-mail with Base64

This method is much more reliable as the actual content from the image is sent within the email. And so there is no need for the receiver to retrieve the image from SharePoint.

Image showing Power Automate Flow that embeds an image into an email using base64

The file content is retrieved with the "Get file content using path" step. Then injected into the e-mail every bit base64, with these expressions:

outputs('Get_file_content_using_path')?['body']['$content-type'] outputs('Get_file_content_using_path')?['trunk']['$content']

The complete image expression would be:

<img src="information:@{outputs('Get_file_content_using_path')?['body']['$content-type']};base64,@{outputs('Get_file_content_using_path')?['body']['$content']}" />

This method works actually well, however some mail service clients practise not back up base64 encoded images within the email body. For case, gmail does non evidence any base64 encoded images.

Another disadvantage of using this method is that the if the image is large, the email will large also. Then exist mindful of the size of the image that you are sending.

Use Ability Automate as a HTTP Spider web Server

The nearly compatible way of embedding images in an email is to a publicly bachelor image on the internet.

Uploading the prototype to a web server or CDN is best. But if yous really want to use SharePoint equally your source, information technology tin can exist done. Its quite easily achieved by creating a catamenia which volition serve image content via HTTP.

Run into this very uncomplicated flow:

Image of a Power Automate Flow that serves email images via HTTPs

This menstruum responds to a HTTP request with a reference to the Image in the URL. The picID in the URL refers to the ID of the image in the SharePoint document library:

Image of SharePoint document library used to store images.

The link to my HTTP Server Flow is:

            https://prod-48.westeurope.logic.azure.com/workflows/59c5a92ccebe4f97adfd52eb6cf213a8/triggers/manual/paths/invoke/picID/{picID}?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=i.0&sig=DNrMaouJY_Sifq8DRvbeWcuDl8TGKgeFpvP9NxDmOcQ          

By modifying the {picID} to the ID of the epitome you desire to serve, your private SharePoint Image will be accessible to the public. The test prototype used in this flow is ID 24, and so this is the link to the dynamically served image. By changing the ID in the URL, a dissimilar image would be served to the customer.

And so now, getting dorsum to our original email flow, we tin modify it like and then:

Image of Power Automate flow linking to to a Power Automate HTTP action to download embedded email images.

Now I tin send the email to almost any client and it volition be able to display the image. At that place are a couple of downsides to this method:

  • It requires a Premium Power Automate license to utilise the "When a HTTP Asking is received" action.
  • The flow will execute every fourth dimension someone looks at the email. If y'all are sending the electronic mail to many recipients, information technology will use a lot of flow capacity.

You could modify this flow to track if emails have been read, past embedding the recipient address in the URL. When the email is served to the client, y'all know the email has been read.

And so what method should you employ?

The method y'all should use to embed an image mostly depends on the capabilities of the recipient:

  • Don't use the kickoff method, unless every one of your recipients is using Outlook Spider web Access.
  • The base64 embedding method works well for the bulk of clients.
  • The HTTP method works well for all clients. Just is more piece of work to implement and not suitable if you are sending to many recipients at in one case.
  • For transaction emails, I recommend using Sendgrid with Power Automate instead, it is much easier and produces a beautiful issue.

Permit me know in the comments how y'all get on and what method you choose!

sherrodmintwoubity.blogspot.com

Source: https://www.tachytelic.net/2021/02/power-automate-embed-image-email/

0 Response to "How to Upload Image So I Can Include It in My Out of Office Message Gmail"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel