cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Antonio1086
New Member

How to include attachment PNG/PDF in body of email as well

Hi all

I have a flow that drops a Power BI file into an email by attachment with a PNG file (or PDF if that works better). Pretty easy to setup and within my body i've also included our team logo using some HTML.  What i'm trying to also do is include as screenshots within the body of email the same PNG screenshot i have attached.  Is there a way to do that?

6 REPLIES 6
fchopo
Super User
Super User

Hi @Antonio1086 

You can embed images into HTML source code of your email, doing something like this:email-image.png

 The expression used in the compose action is the following:

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

And remember to use html view when composing the email ("</>" icon).

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Thank you for your reply, would this also work if my screenshots i'm needing to be in body of email are derived by the Export to File for Power BI Reports action?  I see that you're source pictures are coming from a sharepoint and unfortunately, that's not the initial destination.  My trigger is a weekly reoccurrence as well.

 

Antonio1086_0-1655818479644.png

 

fchopo
Super User
Super User

You can try to export Power BI file to image format (PNG/JPG) and use the output as I use the "get file content" action. 

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

I think i'm following your suggestions.  Would help if i knew HTML better but i'm learning as i go... When i test the flow i get an email with a ton of wingding text....  Can you help with what i'm doing wrong in my HTML please?

<html>
<body>
<img src="C:\Users\xxxxxxxx">
</body>
</html>
<p><br>
@{outputs('Compose')}

<p style="font-family:CalibriLight">
<p style="font-size:16px">
Attached you'll find the monthly update to the ABAC Report. <br>
Thank you!</p>

 

 

Antonio1086_1-1655829135640.png

 

fchopo
Super User
Super User

That's fine, although the problem I see is that you're exporting the file to "C:\..." and you should store that in a SharePoint site or OneDrive -> Save a paginated report to OneDrive for Business or SharePoint Online - Power BI | Microsoft Docs

When you receive the email, what do you see?

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Thank you for your continued help with this, i know i'm close.  So that C:\ path is actually just a screenshot of our teams header/ribbon for email distros.  I will definitely change that to my one drive once i go live with it.  But until then just testing that.  The images that i'm trying to embed are in the outputs expression.  But when i run the flow i just get a very large email with wingding text, basically freezes my outlook so i can't share a screenshot.  When i remove the outputs expression, i get our team header, and the text that i included within the body.  And the PDF (or PNG, whichever would work easier for this i'm indifferent to), is attached but not embedded in the body of the email.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (4,969)