Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/navjotdhanawat/dynamic-mailer

Dynamic mailer is used to send mail with dynamic template of handlebar
https://github.com/navjotdhanawat/dynamic-mailer

email email-template handlebars handlebars-template mail nodemailer send template

Last synced: 9 days ago
JSON representation

Dynamic mailer is used to send mail with dynamic template of handlebar

Awesome Lists containing this project

README

        

# How to Setup: Dynamic Mailer for sending mail with customized template using handlebar, nodejs, express.

```
npm install dynamic-mailer --save

```

Steps:
1. Include package 'dynamic-mailer'
2. Create credentials and data object as below.
3. content, header and footer of template should be in 'td' tag.
4. Just call mailer() function.

```javascript

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: 'Its Google',
header: ' Its Header ',
footer: ' Xxxx xxxx xxxx xxxxx Its footer',
credentials: credentials
}

mailer(data, function(err, data){
console.log(data);
console.log(err);
});

```

## Please let us know if any bug. [Link](https://github.com/navjotdhanawat/dynamic-mailer/issues)