If you're sending out emails using Power Automate and you want to embed an image from SharePoint, you need a clean link.
The basic HTML to embed the image is nice and simple:
<img src="image-url">But getting a link from SharePoint can be tricky. You can't just copy the URL or click Copy Link because that comes with a whole bunch of possible tokens which can make the URL very long and unwieldy.
More than that though, the tokens can include permissions and that can prevent your workflow from accessing the file. What you want is a simple URL that points directly to the file so that Power Automate can use it.
It turns out there is a simple way to get that URL, it's just slightly hidden away.
Select your image file in the library and click ... > Details to open up the Details side bar on the right hand side. Scroll all the way down to the bottom to find the Path information.
Click the Copy icon to get a clean URL directly to the file::
Use that URL in your HTML. Remember the basic HTML from earlier?<img src="image-url">
That was taken from the Microsoft Learn page on this subject and they have forgotten something very important: Adding ALT text.
Making your emails accessible for people with sight issues should be something you do as standard. It's a tiny tweak that looks like this:
<img src="image-url" alt="ALT TEXT">
It's also worth adding in sizing if you need to make sure that an an image always renders as you want it to, and that is equally simple:
<img src="image-url" width="x" height="y" alt="ALT TEXT">
And there you go: a simple method for getting a simple URL for embedding images in emails.

No comments:
Post a Comment
Note: only a member of this blog may post a comment.