cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Priyasantra
Microsoft
Microsoft

How to add a line break in email function

Hi Team, 

 

I am using the below email function and I would like to change the line of the emai. I wanted my email in 3 different paragraphs but I am unable to change this. I have used the <br/> but when I declare the {IsHtml:true} and close the braces It gives error "Your send email function has invalid arguments" I have tried Char(10) even this did not worked can someone help me to correct this 

 

Office365Outlook.SendEmailV2(MyTrainingGallery1.Selected.'Intro Trainer'.Email, "Introduction Training for New Joiner", "Hello "& MyTrainingGallery1.Selected.'Employee Details'.DisplayName &Char(10)&" All the Tools access has been completed/requested And the Introduction Training for the New joiner "&MyTrainingGallery1.Selected.'Employee Details'.DisplayName &" can be started.", {Cc:"xxxx@microsoft.com"})

 

 

I want my email to look like below

 

Subject:- "Welcome"

 

Hi Priya, 

 

All the Tools access has been completed/requested ,and the Introduction Training for the New joiner can be started.

 

Please use the below app link to gain access to the resources and tools and acknowledge the same

 

Regards

 Team

 

 

The above in bold is how my email should look like. After my "Hi Priya" There should be a line break and after "Started" there should be a line break.

 

Needed your help

 

 

Thanks in advance

Regards

Priya

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User III
Super User III

@Priyasantra 

No bother at all...happy to help!

 

So, if you want the Email to happen with the submit of the form - first I would make sure that you are putting the formula in the OnSuccess of the form.  You don't want to send an email saying all is "good", if the submit fails.

 

Next, when you are outside of the Form, you should NOT refer to the internal DataCardValue controls.  Instead you should reference the LastSubmit or Updates property of the Form.  And in this case you would be interested in the LastSubmit.

 

So this would be what you are looking for in the OnSuccess action:

Office365Outlook.SendEmailV2(yourForm.LastSubmit.'Employee details'.Email, "Hi", "hello")

Change the yourForm to the name of your form and, if the 'Employee details' is not the name of the column in your dataSource, then change accordingly.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

RandyHayes
Super User III
Super User III

@Priyasantra 

My pleasure.  Have a great weekend too.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User III
Super User III

@Priyasantra 

SendEmailV2 will send email as HTML by default, so place the line break tags in your formula:

Office365Outlook.SendEmailV2(
    MyTrainingGallery1.Selected.'Intro Trainer'.Email, 
    "Introduction Training for New Joiner", 
    "Hello "& MyTrainingGallery1.Selected.'Employee Details'.DisplayName & 
       "<br>All the Tools access has been completed/requested And the Introduction Training for the New joiner " & MyTrainingGallery1.Selected.'Employee Details'.DisplayName & 
       " can be started.<br>", 
    {Cc:"xxxx@microsoft.com"}
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hello @RandyHayes  

 

This has worked like a charm and this why I call you a super star. Thanks again for this help

 

I have one last query i would like to add it in the same email and that is 

 

I am creating this application for Onboarding which has 4 different stages 

 

1. New onboarding 

2. Access Toolss

3. Technical training 

4. Onboarding completion

 

Every stage there is a form and each time a form is submitted it sends an email to the feilds that I declare in the Sendemail function - MyTrainingGallery1.Selected.'Intro Trainer'.Email,. So when a form is submitted this function sends an email to the person field which is "Intro Trainer". I have cracked every thing and this email function works great.

 

 

Now if you look at the below screenshot you will see that there are 4 buttons at the left hand side. The first button is "New Onboarding". When clicked on the "New Onboarding" it gives a form as shown below, Now I wanted that when I fill out the form and click on submit it should trigger an email to the person column "Employee details"

 

For example the above email which you helped adding a break tag. If you see the email is sent to MyTrainingGallery1.Selected.'Intro Trainer'.Email

 

I am currently trying something like  Office365Outlook.SendEmailV2(DataCardValue2.Selected.Value, "Hi", "hello")

 

For example the above email which you helped adding a break tag. If you see the email is sent to 

Datacardvalue 2 is for the employe details data card. But this does not work. Could you help me with this one last thing?

 

 

Priyasantra_0-1606936786299.png

 

I am sorry for bothering you a lot but I have asked help to many but no one could help mw with this so asking you

 

Regards

Priya

RandyHayes
Super User III
Super User III

@Priyasantra 

No bother at all...happy to help!

 

So, if you want the Email to happen with the submit of the form - first I would make sure that you are putting the formula in the OnSuccess of the form.  You don't want to send an email saying all is "good", if the submit fails.

 

Next, when you are outside of the Form, you should NOT refer to the internal DataCardValue controls.  Instead you should reference the LastSubmit or Updates property of the Form.  And in this case you would be interested in the LastSubmit.

 

So this would be what you are looking for in the OnSuccess action:

Office365Outlook.SendEmailV2(yourForm.LastSubmit.'Employee details'.Email, "Hi", "hello")

Change the yourForm to the name of your form and, if the 'Employee details' is not the name of the column in your dataSource, then change accordingly.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Hello @RandyHayes 

 

You are not only the Super star. You are the Santa Clause😊 of powerapps to me. Thankyou soo much.  Your answer has provided resolution to my problem that I was looking for from months and months. 

 

Thankyou ssoo soo much again

 

You have a happy weekend

 

Regards

Priya

 

RandyHayes
Super User III
Super User III

@Priyasantra 

My pleasure.  Have a great weekend too.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,222)