I am new to node.js and not able to figure out how to reference js library postmark.js in node.js.
var POSTMARK_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
var postmark = require("postmark")(POSTMARK_KEY);
postmark.send({
"From": from,
"To": to,
"Subject": subject,
"TextBody": emailBody
}, function (err, to) {
if (err) {
console.log(err);
return;
}
console.log("Email sent to: %s", to);
});
I tried above code but not sure how to use postmark.js
Is there any easy way to have html email functionality using html templates in js?
You can find most of the information in the official wiki.
To send an email with a template use: