Skip to main content
1-Visitor
October 25, 2017
Solved

Get properties dynamically within email body

  • October 25, 2017
  • 8 replies
  • 3536 views

Hi All

I am trying to send an email (which all works fine) with some basic HTML, but need to call various Thing Properties, how do I go about this:

var myHTML = "<html><head></head><body>\

<h1>Title</h1>\

Content bla bla bla <i>italic</i>\

</body></html>";

var params = {

cc: undefined /* STRING */,

bcc: undefined /* STRING */,

subject: "High Usage Warning" /* STRING */,

from: "87@Litres" /* STRING */,

to: "ssssss@ssss.com/* STRING */,

body: myHTML

}

// no return

Things["EmailServer"].SendMessage(params);

Best answer by CarlesColl

Just build the string:

"whatever text "+myVariable+" whatever text more "

8 replies

1-Visitor
October 25, 2017

Just build the string:

"whatever text "+myVariable+" whatever text more "

Darryl1-VisitorAuthor
1-Visitor
October 25, 2017

That worked perfectly thanks.

Another thing, how do I insert a big block of html content - i.e. html with pictures and tables etc.

I keep getting syntax errors, even when just trying <img src"http://xxxxxxxxxxxx">

1-Visitor
October 25, 2017

You have to scape " --> \" or use single quote '