1

Notifications - HTML format in notification email

Тема: Notifications - HTML format in notification email

Hello All,
Is there any way to send email notifications in HTML format? I see there is an option in Email Action

{
    "t":"email",        /* action type */
    "p":{
        "email_to":<text>,    /* e-mail address */
        "html":<text>,        /* use HTML tags: 0 - no, 1 - yes  */
        "img_attach":<text>,    /* attach image from notification: 1 - yes, 0 - no */
        "subj":<text>        /* text of message */
    }
}

Tried setting "html" to 1 and used HTML formatted text in 'txt' while creating a notification using 'update_notification' remote API, but then the API returned 4 (Invalid Input). Also in Wialon UI, I don't see an option to use HTML in email. Thanks in advance!

2

Notifications - HTML format in notification email

Re: Notifications - HTML format in notification email

m-ram, show your parameters You tryed to create notification with.
May be there were unescaped quotes in txt and so on.

Head of Wialon Local Department
Gurtam
3

Notifications - HTML format in notification email

(12/12/2016 19:07:29 отредактировано m-ram)

Re: Notifications - HTML format in notification email

{"itemId":14622918,"id":0,"callMode":"create","la":"en","ma":0,"mmtd":86400,"n":"Notificaton1","sch":{ "f1": 0, "f2":0, "t1":0, "t2":0, "m":0, "y":0, "w":0},"ta":0,"td":0,"trg":{ t:"speed", "p": { "min_speed": 0, "max_speed":50} },"txt":"<!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="utf-8" /><title></title></head><body><p><strong>Bold Text</strong></p></body></html>","act":[ { "t":"email", "p":{ "email_to":"", "html": 1, "img_attach": 0, "subj":"Speeding Notifications [Company: DemoCus...]" } }],"fl":0,"cdt":0,"cp":0,"mast":0,"mpst":0,"tz":-18000,"un":[14623074]}

Please see above the complete params value, thanks for the response.

4

Notifications - HTML format in notification email

(12/12/2016 16:10:40 отредактировано deal)

Re: Notifications - HTML format in notification email

m-ram, as I expected You have unescaped quotes. Add slashes and You'll get correct result.
Just fix Your HTML like this:

<!DOCTYPE html><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta charset=\"utf-8\" /><title></title></head><body><p><strong>Bold Text</strong></p></body></html>
Head of Wialon Local Department
Gurtam