cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
giselisestari
Regular Visitor

Office365.sendmail - new line

Created an app, and I would like to send more than one line in the body of the email. Can you do that?

Sorry for the english, I'm Brazilian so there may be some errors. 🙂

 

Office365.SendEmail('E-mail do Cliente_DataCard1'.Default; "Descrição do Atendimento" & 'Descrição Atendimento_DataCard2'.Default; "Nome do Cliente: " & 'Nome do Cliente_DataCard2'.Default & "Produto: " & Produto_DataCard2.Default;{Attachments:Table({Name:"Teste.jpg";ContentBytes:MyDoodles.Image;'@data.type':""})})

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

Boa tarde 🙂

You can use the Char(10) expression, which represents a new line character, to split the message body in multiple lines, like in the example below:

Office365.SendEmail(
    'E-mail do Cliente_DataCard1'.Default;
    "Descrição do Atendimento: " & 'Descrição Atendimento_DataCard2'.Default;
    "Nome do Cliente: " & 'Nome do Cliente_DataCard2'.Default & Char(10) &
        "Produto: " & Produto_DataCard2.Default;
    {
        Attachments: Table(
            { Name: "Teste.jpg"; ContentBytes:MyDoodles.Image; '@odata.type':"" }
        )
    })

Another hint that I noticed - the Default property of the cards stores the initial values from the data source. If the user types something different in the text input controls, for example, the Default property will not be changed. You can use the Update property of the card, which should have the current version of the text input:

Office365.SendEmail(
    'E-mail do Cliente_DataCard1'.Update;
    "Descrição do Atendimento: " & 'Descrição Atendimento_DataCard2'.Update;
    "Nome do Cliente: " & 'Nome do Cliente_DataCard2'.Update & Char(10) &
        "Produto: " & Produto_DataCard2.Update;
    {
        Attachments: Table(
            { Name: "Teste.jpg"; ContentBytes:MyDoodles.Image; '@odata.type':"" }
        )
    })

Hope this helps!

View solution in original post

6 REPLIES 6
JLockwood
Frequent Visitor

If you set IsHtml to true, then you can use break tags:

 

 

Office365.SendEmail(emailto, "Testing Linebreaks", "This is <br> <br> a test", {IsHtml: true})

 

LineBreak.png

CarlosFigueira
Power Apps
Power Apps

Boa tarde 🙂

You can use the Char(10) expression, which represents a new line character, to split the message body in multiple lines, like in the example below:

Office365.SendEmail(
    'E-mail do Cliente_DataCard1'.Default;
    "Descrição do Atendimento: " & 'Descrição Atendimento_DataCard2'.Default;
    "Nome do Cliente: " & 'Nome do Cliente_DataCard2'.Default & Char(10) &
        "Produto: " & Produto_DataCard2.Default;
    {
        Attachments: Table(
            { Name: "Teste.jpg"; ContentBytes:MyDoodles.Image; '@odata.type':"" }
        )
    })

Another hint that I noticed - the Default property of the cards stores the initial values from the data source. If the user types something different in the text input controls, for example, the Default property will not be changed. You can use the Update property of the card, which should have the current version of the text input:

Office365.SendEmail(
    'E-mail do Cliente_DataCard1'.Update;
    "Descrição do Atendimento: " & 'Descrição Atendimento_DataCard2'.Update;
    "Nome do Cliente: " & 'Nome do Cliente_DataCard2'.Update & Char(10) &
        "Produto: " & Produto_DataCard2.Update;
    {
        Attachments: Table(
            { Name: "Teste.jpg"; ContentBytes:MyDoodles.Image; '@odata.type':"" }
        )
    })

Hope this helps!

View solution in original post

Thank you worked out using char (10) and I followed your tip. PowerApps is a fascinating product. Thanks.

Thank you it worked, com o IsHTML.
Thanks.

Char(10) , Char(13) or both together , nothing working. OR it stopped working now.

It appears that with the new V2 Office365.sendmail connector the emails default to HMTL format which means that char(10) will no longer work. Instead use <br> to create a new line in your email.

e.g.

 

Office365Outlook.SendEmailV2(
"email@email.com",
"New Request",
Concat(
Request,
"Todays Date: " & Todays_Date & "<br><br> Requestor: " & Requestor & "<br> Urgency: " & "<br> Scope: " & Scope & "<br> Action By: " & CompleteBy & "<br> What is required: " & What & "<br> Why is this required: " & Why
)

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,494)