Email body formatting
Hi,
this may be a bit of a simplistic question for some of you but I wanted to know how I can format the body text of the email alerts I send out. Currently I just use a plain text string, but it doesn't look particularly professional. I understand (or can read up on) html tags, what I don't understand is how I can enter dynamic data (property values) into the html. The dynamic data can be different every time
so currently I would do something like below where the values in bold are taken from the asset properties.
var params =
{
subject: "Fault State on ASSET " + source /* STRING */,
from: "my.iot@gmail.com (do not reply)" /* STRING */,
to: "user1@gmail.com" /* STRING */,
bcc: "user2@gmail.com" /* STRING */,
body: "Remote Asset " +source+" (" + me.MachineName + ") has encountered a fault! [1."+row.eventid+" "+row.description+"]. If problem persists please contact your local supplier"
};
// no return
Things["My.MailServer"].SendMessage(params);
Would anyone have a couple of examples, or point me in the direction of some documentation?
Thanks,
K

