Page 1 of 1

How to put newline in dzVents notification email

Posted: Tuesday 17 October 2017 12:06
by lazyoldjack
So, how can I put a VISIBLE newline into the email that I send?

Because the emails arrive as HTML I tried <br/> but that gets encoded as &ltbr/&gt; so just shows as <br/>.

So I tried \n which DOES put in a newline BUT, of course, the HTML masks that (though it DOES appear in the pushbullet at least)

Any thoughts/help would be welcomed! :D

Re: How to put newline in dzVents notification email

Posted: Thursday 10 May 2018 8:00
by elgringo
Figured out how to do this? If so enlighten me :)

How to put newline in email

Posted: Thursday 06 June 2019 22:52
by uc530
Hello!
I have a problem with email sending in lua script. I want to send email body in more lines, but I dont know how.
the part for sending:

bodytext = PowerConsumption.."A, user1= "..Power1.."A, user2= "..Power2.."A, user3= "..Power3.."A"
commandArray["SendEmail"]=subject.."#"..bodytext.."#"..emailAddress

This works, but I want to have each user in new line. I tried with \n and <br> but with no luck
Thanks in advance!

Re: How to put newline in dzVents notification email  [Solved]

Posted: Monday 10 June 2019 22:43
by waaren
elgringo wrote: Thursday 10 May 2018 8:00 Figured out how to do this? If so enlighten me :)
This seem to work in Gmail.

Code: Select all

        local multiLine = 'test1\\ntest2\\ntest3\\n' 
        domoticz.email('multi line test',multiLine, '[email protected]')
mail.png
mail.png (29.03 KiB) Viewed 1678 times