I marked a solution below as to what is needed for the images to work for this flow. But ultimately my issue was because of the image file size (not the format).
---------------------------------------------
I'm working a flow and everything works as expected for a news post's Banner Image URL using a jpg image file. But when a PNG image file is being used instead, the image does not display in the email desktop application nor the web application for Outlook. The JPG file does show, though, in both Outlook's desktop and web. And Outlook is the primary email application being used for our purposes.
I'm using two "Get File Content Using Path" steps. The first one is a static image, and that works just fine. The second one needs to be dynamic per the news post, and that is the one that works with jpgs but not pngs. The input url for the file path in this second one works when I paste it into the browser search bar. I've attached a partial screenshot of what the output for this second "Get File Content Using Path" looks like. It is super long!
Here are the expressions for the datauri items in the email body:
1st instance: @{dataUri(outputs('Get_file_content_using_path')?['body'])}
2nd instance: @{dataUri(outputs('Get_file_content_using_path')?['body'])}
I've tried every solution I could find, but haven't been able to figure this out. Maybe it is something so simple that I am missing?! I'm fairly new at this, so learning as I go along. I've attached screenshots of the flow. Hoping there is an answer out there! Thank you!
Hello! What I ended up doing wasn't pretty and I'm not sure ideal for long-term solution, but it is working for us at the moment! We ended up grabbing that image and converting it into a JPG within the flow by downloading it to a OneDrive business folder with format of ".jpg". Since the issues we were having were large PNG files.
There are some options for steps that could help you. Convert File (if it is a OneDrive file) and Compress Image/Convert Image Format but for these last 2 I didn't know how to use it since it's asking for an API key.
Dear Flowuser6,
Greetings!
We have the similar requirement to automate the news/post. We are facing the same issue (if we add image with size more than 500kb approx. in the banner image url [it didnt worked when i tried with 800kb] the images are getting removed in the email that we receive). Did you get chance to find any work around for this as you mentioned above? It would be very helpful if you could share some idea.
If anyone has came across this scenario and implemented any work around, please feel free to suggest!
Thanks
Hi Ellis! I figured out the issue. I feel so foolish! So, last night I had a thought, maybe it is the file size of the png file that is causing the issue. PNG files are always larger than JPG files. So, this morning I resaved the png file so the file size wasn't as large. Previously it was 1.24 MB and this morning I tested with a png file size of 528 KB. This was the issue!!! The png file sizes that the flow was trying to include were too large. Do you happen to know a definite file size limit? If not, I'll keep testing to see the cut off point for png file sizes embedded in an email. Maybe try to see if there is a way to compress the image within the flow..
Oh my goodness!! Thank you so much for bearing with me and testing this all out. You've been the only actual support I've had with this issue, so I greatly appreciate it!!!
Here are the screenshots I took of the flow output and email received this morning after reducing the png file size.
Yes, access to the SiteAssets/SitePages seems to be fine. It is still worth testing, by sending an PNG file that is stored in a Document Library - to see if you get the same problem.
To demonstrate, I created a new flow to read a PNG file from the /SiteAssets/SitePages on my SharePoint site:
This is the email that was sent, and the PNG image is visible in Outlook:
Ellis
I don't think I have issues accessing content from the SiteAssets/SitePages folder. The flow works perfectly fine with a jpg file. I've attached screenshots. Would this suffice to rule out any issues accessing content from the SiteAssets/SitePages folder? If not, I can run a flow as requested tomorrow!
Email Received:
Email Received when JPG file is used instead of PNG
Email Body
Get File Content Using Path when the Banner Image URL is referencing a jpg not png:
Get File Content Using Path Output Download
Asa test can you test your flow using an image located in a Document Library and not from the /SiteAssets/SitePages folder. Any image will do, you just need the Site Address and File Path. We are trying to rule out any issues with accessing content from the /SiteAssets/SitePages folder.
For example:
Then create a new flow or modify your existing flow:
Ellis
Attached is a screenshot of the email I receive, it is just blank. In the browser application, when I use the inspect tool from the browser, this is what it reads:
<img data-imagetype="Empty" data-imageerror="SrcNullOrEmpty">
Here are the screenshots of the flow. So, I'm using the compose steps at the beginning to get the clean url from the Banner Image URL dynamic item (maybe these initial steps is what is wrong with my flow?). I'm using these, though, to get the clean version of the Banner Image URL since when I first inserted that into the "Get file content using path" didn't work. And here are the screenshots of the outputs.
email received
Compose steps to get file path of Banner Image Url:
The compose steps to get the file url
Compose Outputs after "Get file content using path 2":
compose steps after Get File Content Using Path
(1) Please show the message that is sent, for example the demo flow I created sent the following email message and image:
(2) and please show the outputs of the compose action:
This is the demo flow that I have been using:
Ellis
Ellis, thank you very much for sticking with this and helping me out! I tried an email with just the image tag as suggested, but it still didn't work out for me.
Email Body
Email Run
Email Input Download:
Email Input Download
Email Output Download:
Email Output Download
Please show the runtime output again.
If the content-type and content appear OK, then I suspect it's the HTML code used in the send email action.
Can you construct a very simple Send Email action such as:
<img src="data:@{outputs('ComposeContentType')};base4,@{outputs('ComposeContent')}">
Ellis