How to put newline in dzVents notification email  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
lazyoldjack
Posts: 6
Joined: Saturday 19 November 2016 11:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

How to put newline in dzVents notification email

Post 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
elgringo
Posts: 95
Joined: Thursday 18 May 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Left
Contact:

Re: How to put newline in dzVents notification email

Post by elgringo »

Figured out how to do this? If so enlighten me :)
uc530
Posts: 6
Joined: Tuesday 07 March 2017 0:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

How to put newline in email

Post 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!
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post 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 1578 times
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest