mandrill-send-template
v0.1.1
Published
Simple wrapper around mandrill's send-template.json API call. Makes the interface a bit nicer.
Downloads
11
Readme
mandrill-send-template
Simple wrapper around mandrill's send-template.json API call. Makes the interface a bit nicer.
Usage
var sendTemplate = require('mandrill-send-template')
sendTemplate({
to: ['[email protected]'],
template: 'reset-password',
params: {
name: 'Test User',
link: 'http://www.test.com/password-reset?key=PasswordResetKey'
}
}, function(err, res) {
})
We automatically translate arrays of email addresses into mandrill's format for you. We also translate params
into global_merge_vars
array format. Similarly for user-specific merge-vars, you may do this:
sendTemplate({
userParams: {
'[email protected]': {
name: 'Other name'
}
}
})
And it will override the global params
. Also supported are attachments
and images
in the standard way. Right now the supported fields are a whitelist and they are tuned to the fields I happen to care about for my purposes. If you want others, feel free to send a pull request.