An example for using the mandrill template with nodejs.
- NodeJs
- Mandrill account
- Go to Mandrill Templates and create new template.
- In the Mandrill Sending options set Merge Language to Handlebars (in the bottom).
- Copy
template.html
from this repo to the HTML field in mandrill. npm install
- Create
config.local.js
in your folder (look example below)
'use strict';
module.exports = {
mandrillApiKey: 'MANDRILL-API-KEY',
templateSlug: 'your-template-slug',
toEmail: '[email protected]'
};
node index.js
You can find more about parameters for mandrill send template here: https://mandrillapp.com/api/docs/messages.nodejs.html#method=send-template