optune-mailer
Opinionated package for simplifying mailing via mailgun.com
Preconditions
- CoffeeScript
- A Mailgun account
- Mandrill API Key in Env vars
Installation
npm install optune-mailer --save
Usage
mailer = require 'optune-mailer'
mailer.sendText 'Debug <debug@optune.me>', 'Test subject', 'Test body', callback
# Events:
mailer.on 'send', (opts) ->
console.log opts
# opts:
# from: ...
# to: ...
# subject: ...
# text or html: ...
Expected ENV Vars
(For testing, put a .env file in the root with the following content)
MAILGUN_APIKEY=YOUR_MAILGUN_API_KEY
License
LGPL v3