mandrill-send-template
Simple wrapper around mandrill's send-template.json API call. Makes the interface a bit nicer.
Last updated 5 years ago by ashaffer88 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mandrill-send-template 
SYNC missed versions from official npm registry.

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: ['user@test.com'],
  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: {
    'test@user.com': {
      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.

Current Tags

  • 0.1.1                                ...           latest (5 years ago)

2 Versions

  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |