mailgunny
v0.0.1
Published
A tiny node.js module to send emails through mailgun's API.
Downloads
6
Readme
Mailgunny
A tiny module to send emails through mailgun's API.
Install
With npm:
npm install mailgunny
Example
var Mailgunny = require('mailgunny');
var mail = new Mailgunny({
domain: 'example.com',
key: 'mailgunapikey'
});
mail.send({
from: '[email protected]',
to: ['[email protected]', '[email protected]'],
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.');
});
API
Initialize Properties
Required
- domain (String) The domain that you have a mailgun DNS record setup to send email from
- key (String) The mailgun apikey
Optional
- complete (Function) The callback function if every email will use the same callback
Methods
.config(settings)
- See "Initialize Properties"
.send(email, callback)
email 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
callback(request, response)
- The mailgun callback
License
MIT
Todos
- tests