Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Attach an html file in send an email with AttachementContent as image item in html

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have a requirement where I want to send an email with an attachment. This attachment should be of html format and should have attachmentcontent(an image) as an image in html. This attachmentContent is output of previous Kusto query.

 

  • Re: Attach an html file in send an email with AttachementContent as image item in html

    I have a similar problem and tried your thing.

     

    But there is a fault at my flow: The response is not a JSON format?

     

    MarvinBier_0-1594836292970.png

     

    MarvinBier_1-1594836318055.png

     

     

  • swetaag2011 Profile Picture
    swetaag2011 on at
    Re: Attach an html file in send an email with AttachementContent as image item in html

    Thanks a lot for the pointers, I solved the problem by directly consuming AttachmentContent in my compose "Body" formula and it works.

  • swetaag2011 Profile Picture
    swetaag2011 on at
    Re: Attach an html file in send an email with AttachementContent as image item in html

    Thanks for responding, This is very helpful, however my image file is a JPEG image which is the out put of previous step.

    This AttachmentContent is a JPEG file which I am trying to embed, but this is not working.

    Attaches screenshot:image.png

     

     

  • v-xida-msft Profile Picture
    v-xida-msft on at
    Re: Attach an html file in send an email with AttachementContent as image item in html

    HI @swetaag2011,

     

    Could you please share a screenshot of your flow's configuration?

    Do you want to include the image into a html file and display it in the html file?

     

    If you want to include the image into a html file and display it in the html file, I have made a test on my side and please take a try with the following workaround:

    • Add a proper trigger, here I use Flow Button trigger.
    • Add a "Get file content" aciton, File field set to a specific image file.
    • Add a "Compose" action, Inputs set to following html data:20.JPG

      The formula within src property as below:

    • body('Get_file_content')?['$content']
      Add a "Send an email" action, Attachments Name field set to Test.html and Attachments Content field set to output of "Compose" action.

    Image reference:21.JPG

    The flow works successfully as below:22.JPG

     

    23.JPG

     

    The html file opens successfully as below:

    24.JPG

     

    Best regards,

    Kris

     

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,495

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,822

Leaderboard