0.0.1 • Published 9 years ago

mailgunny v0.0.1

Weekly downloads
13
License
-
Repository
github
Last release
9 years ago

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: '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.');
});

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
0.0.1

9 years ago