I've the image saved at OneDrive, with granted view access to all people having the link, and I'm sending an email as html file, and want to display my image there, so I'm using the below code:
<img src="https://company-my.sharepoint.com/personal/myemail/Documents/public/FLK-LogoMini.png" alt="my logo">
The above is working fine once I'm opening the email at Office 365 web.
The above is not displaying neither at Outlook web, nor at gmail, nor at outlook desktop, nor at mobile apps!
I searched alot, and found a recomendation to use base64
, so i converted my image into base64 string using https://www.browserling.com/tools/file-to-base64, then used the image tag as:
<img src="data:image/png;base64,@{variables('image')}/">
The @{variables('image')}
is the base64 string, but it is appearing in this format as I'm reading it using power automate flow:
The base64 string image, had been dispaled correctly only at MS oulook desktop up, and not displayed at any web based app or mobile app.
I've 3 questions, hoping to get the support with:
Is there a unified way to get the image displayed properly every where, gmail, outlook, outlook app, office 365 outlook, ..
If the answer of point 1 is "no", how can I display the image at web based email clients, like gmail?
Is there a way to use CSS or JavaScript in the html email, so I can read the time of the client and use the proper way to display the image, something like:
// I tried JS but looks it is not working inside html email!
if (client === outlook_Desktop_app) {
<img src="data:image/png;base64,@{variables('image')}/">
} else if (client === office365_outlook) {
<img src="https://company-my.sharepoint.com/personal/myemail/Documents/public/FLK-LogoMini.png">
} else { // i.e. web based like gmail and outlook web
<img src="xxxx/FLK-LogoMini.png">
}