dynamic-mailer
v1.0.8
Published
Dynamic mailer is used to send mail with dynamic template of handlebar
Downloads
4
Maintainers
Readme
How to Setup: Dynamic Mailer for sending mail with customized template using handlebar, nodejs, express.
npm install dynamic-mailer --save
Steps:
- Include package 'dynamic-mailer'
- Create credentials and data object as below.
- content, header and footer of template should be in 'td' tag.
- Just call mailer() function.
var mailer = require("dynamic-mailer").sendEmail;
var credentials = {
from: "[email protected]",
host: "smtp.server.net",
secureConnection: true,
port: 465,
transportMethod: "SMTP",
auth: {
user: "[email protected]",
pass: "**********"
}
};
var data = {
from: '[email protected]',
to : '[email protected]',
subject: 'Mail Subject',
content: '<td><a href="www.google.com">Its Google</a></td>',
header: '<td style="color:brown;font-size:22px;border-bottom:2px solid brown"> Its Header </td>',
footer: '<td style="padding:15px 20px;text-align:center;padding-top:5px;border-top:solid 1px #dfdfdf"> Xxxx xxxx xxxx xxxxx Its footer</td>',
credentials: credentials
}
mailer(data, function(err, data){
console.log(data);
console.log(err);
});