Skip to content

shanebo/mailgunny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A tiny node.js module for sending mailgun emails.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published