web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / sending HTML Emails wi...
Power Apps
Answered

sending HTML Emails with Power Apps button

(0) ShareShare
ReportReport
Posted on by 41

OK so here is my current challenge 

 

I have a button in my app using the Emailv2 sneding an email to the submitter 

 

Office365Outlook.SendEmailV2(
"christine.turnbull@diabetes.org.uk"," TEST Project ID - " & ThisItem.'Project ID' & "Project Title - " &
ThisItem.Title,Label9,
{
Importance:"Normal"})

 

label 9 contains the following 

Text = RichTextEditor5.HtmlText

 

But from one day to the next the Ritch Text editor 5 

looses its text 

it shows this in default 

ChrisTu_0-1616413169676.png

 

ChrisTu_1-1616413244015.png

this looses its content which should be 

Hi

Thank you for submitting your project for initial assessment by the IT, Digital, Marcomms and Insight and Analysis teams.

Please now contact these teams to discuss the details of your project.

 

Thanks 

Marcomms contact – xxx

IT contact – xxx

Digital contact – xxx

Insight and Analysis contact – xxx

 

any ideas as the emails where right on Friday and wrong today I am currently trying to do this without the use of Power Automate 

 

Chris 

thanks 

Categories:
  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @ChrisTu , I'm curious why are you using a rich text box? 

    a variable in OnVisible will create the message you want like this

    UpdateContext({myMessage: "

    <p>Hi</p>

    <p>Thank you for submitting your project for initial assessment by the IT, Digital, Marcomms and Insight and Analysis teams. Please now contact these teams to discuss the details of your project.</p>

    <p>Thanks</p>

    <p>Marcomms contact –</p>

    <p>IT contact – xxx</p>

    <p>Digital contact – xxx</p>

    <p>Insight and Analysis contact – xxx</p>

    "})

    Office365Outlook.SendEmailV2(
    "christine.turnbull@diabetes.org.uk"," TEST Project ID - " & ThisItem.'Project ID' & "Project Title - " &
    ThisItem.Title,myMessage,
    {
    Importance:"Normal"})

     

    hope this helps

     
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ChrisTu 

    The RichText editor is notoriously picky!  Are you stating you had a formula in that control and it is going away?

    Not entirely sure why you have a label for the contents of the RichText control...as the RichText control already has your content.

    So, your formula should be this:

    Office365Outlook.SendEmailV2(
     "christine.turnbull@diabetes.org.uk",
     " TEST Project ID - " & ThisItem.'Project ID' & "Project Title - " & ThisItem.Title,
     yourRichTextName.HtmlText,
     {Importance:"Normal"}
    )

     

    But as for it disappearing, what are you setting it to initially?

  • ChrisTu Profile Picture
    41 on at

    thanks @rubin_boer I am not knowledgeable on HTML code and the use of Rich text box had been suggested

    Your text above I assume has the required HTML code in it to start a new line but i am not sure what you mean by 

    a variable in OnVisible will create the message you want like this

    should I pop this into a label as it is the contents of the email or into the button "on select" 

    I apologise as my app is great but the rick text box keeps losing its contents 

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ChrisTu 

    You don't need to set variables for this.  Your RichText input can be used to provide the contents of the HTML to the email.  

    But, that is not your issue.  Your issue is that you say the Default on your RichText editor is getting lost.  So, what is it that you have on the control default?

  • ChrisTu Profile Picture
    41 on at

    Hi 

    the rich text box keeps returning to this default 

    "Enter some <strong>rich text</strong> here."

    I assume it should be something else but what ???

     

     

    thanks guys this is a real help 

     

    Chris 

     

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ChrisTu 

    Well...that's the question then...what do you WANT it to be?

     

    Default will determine what the default htmltext is that is in that control.  If you change it manually (i.e. type something into the richtext control) it will only retain that until the control is reset.

     

    Do you want it to be a static default or an empty richtext for people to enter information?

    OR are you only trying to get the correct HTML to use for your email just so you can skip creating your own HTML?

    In other words, is the richtext editor there in order to allow users to enter in the content of the Email message, or is this just a temporary control?

  • ChrisTu Profile Picture
    41 on at

    ok so the email will always be the same whatever item they select in the gallery, 

    I am typing the text into the rich text box and as soon as I go back to that page it is cleared again 

    ChrisTu_0-1616421796576.png

    I need this text to remain in the rich text box 

     

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ChrisTu 

    Yes, so your Default property is not being set to anything.

    But the question remains which is most relevant - is the RechText control going to be there for people to ty0pe into as well?  I understand you want a default there, but is it expected that the user will see that default message and then have the option of adjusting it before sending the message?

     

  • ChrisTu Profile Picture
    41 on at

    hi

     

    no the rich text box is normally hidden as the content never changes 

    I am happy to do away with the rich text box so long as i can select a button and populate a "nice" looking email where the content of the email never changes ( the project no and name are in the email header) 

     

     

    Chris 

     

    Chris   

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ChrisTu 

    So then you just need to put the html into your SendEmail function.  There is no need for the RichText control and certainly not a variable.

     

    Your formula would be this:

    Office365Outlook.SendEmailV2(
     "christine.turnbull@diabetes.org.uk",
     " TEST Project ID - " & ThisItem.'Project ID' & "Project Title - " & ThisItem.Title,
     "<p>Hi</p>
     <p>Thank you for submitting your project for initial assessment by the IT, Digital, Marcomms and Insight and Analysis teams. Please now contact these teams to discuss the details of your project.</p>
     <p>Thanks</p>
     <p>Marcomms contact – xxx</p>
     <p>IT contact – xxx</p>
     <p>Digital contact – xxx</p>
     <p>Insight and Analysis contact – xxx</p>
     ",
     {Importance:"Normal"}
    )

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard