Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Inserting external email body content when composing email

(0) ShareShare
ReportReport
Posted on by 4

Hi guys,

 

I am setting up an automatic email from a shared inbox. Due to company security policy, I cannot share the flow with any of my team members (who could then theoretically change the 'send as' field), but I would like them to be able to edit the body of the message. I had thought a way around this could be to pull into the flow a file (probably html, but i'm open to alternatives if they work). This file would be saved on Sharepoint so that my team could edit the content and formatting. The flow would reference this content in the message body of the automatic email.

I could do it writing the email body in excel, or a Sharepoint list, but then there would be no formatting, and is not really practical. Everything I have found online seems to ultimately end in copy and pasting the html into the flow, rather than referencing it from somewhere else. Am I missing something really obvious?

  • VictorIvanidze Profile Picture
    12,534 on at
    Re: Inserting external email body content when composing email

    Glad to help. If you can mark it as a solution please do that.

  • fsuarezoedt Profile Picture
    46 on at
    Re: Inserting external email body content when composing email

    That worked great! Thank you!

    I like better changing the @{variables('Variable1')} for another placeholder like %%Variable1%% because that will do the HTML more readable.

     

    Thank you again!

  • VictorIvanidze Profile Picture
    12,534 on at
    Re: Inserting external email body content when composing email

    Update: the first replace should be

    replace(outputs('Get_file_content_using_path')?['body'], concat('@{variables(','''','Variable1','''',')}'), variables('Variable1'))
  • VictorIvanidze Profile Picture
    12,534 on at
    Re: Inserting external email body content when composing email

    To minimize the changes required, try to use this:

    replace(outputs('Compose'),'@{variables(\'Variable1\')}',variables('Variable1'))

    If it will not work, in the HTML template use something like  %%Variable1%% instead of @{variables('Variable1')}

    And replace will look like

    replace(outputs('Compose'),'%%Variable1%%',variables('Variable1'))

     

     

     

  • fsuarezoedt Profile Picture
    46 on at
    Re: Inserting external email body content when composing email

    And what would you replace by what, and where?

     

    I have an external HTML file that has the email I want to send inside, with the "@{variables('Variable1')}".

     

    When I load the file with the "Get file content", the exact HTML file is put in memory (or in a variable if you prefer, or a Compose).

     

    If I put the variable in an email, the email is sent with the "@{variables('Variable1')}" verbatim. I get an email with that text. But I want that PA replaces "@{variables('Variable1')}" with the content of the Variable1.

     

     

  • VictorIvanidze Profile Picture
    12,534 on at
    Re: Inserting external email body content when composing email

    As HTML is just a text, use the string replace() function then. Or I misunderstood you?

  • fsuarezoedt Profile Picture
    46 on at
    Re: Inserting external email body content when composing email

     No, but that's not what I'm trying to do. You are using the compose to put the HTML code and then you add the fileds inside. That's ok, and that works.

    But we need a different approach.

    We have dozens of HTML templates (emails). Currently we use your approach. But the idea is to have the HTML in an external repository (Sharepoint) and do the "load" of the HTML (see the action "Get file content in my screenshot), and use that HTML. Same procedure that @creativeopinion used. But his content was static. We need to use fields INSIDE those HTML files.

  • VictorIvanidze Profile Picture
    12,534 on at
    Re: Inserting external email body content when composing email

    Here is my flow that works prorperly:

    VictorIvanidze_1-1713435950680.png

     

     

     

  • fsuarezoedt Profile Picture
    46 on at
    Re: Inserting external email body content when composing email

    Tried like this:

     

    fsuarezoedt_0-1713435196242.png

     

    but the output is still verbatim. No field is replaced by the value

  • VictorIvanidze Profile Picture
    12,534 on at
    Re: Inserting external email body content when composing email

    In the "Send an email notification (V3)" you forget to switch to HTML mode. Click </> to do that.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1