A tiny module to send emails through mailgun's API.
With npm:
npm install mailgunny
var Mailgunny = require('mailgunny');
var mail = new Mailgunny({
domain: 'example.com',
key: 'mailgunapikey'
});
mail.send({
from: 'nacho@libre.com',
to: ['hector@jimenez.com', 'nacho@libre.com'],
subject: 'You have not been baptizzzzed!',
html: "<h1>I'm worried about your salvation and stuff...</h1>"
}, function(req, res){
console.log('Email was sent.');
});
- domain (String) The domain that you have a mailgun DNS record setup to send email from
- key (String) The mailgun apikey
- complete (Function) The callback function if every email will use the same callback
- See "Initialize Properties"
- from (String || Array) The email address(es) the email is coming from
- to (String || Array) The email address(es) the email is going to
- subject (String) The email's subject line
- html (String) The email body
- text (String) The email plain text
- The mailgun callback
MIT
- tests