resilient-mailer

0.1.1 • Public • Published

resilient-mailer

resilient-mailer provides fault-tolerant email delivery, using failover email providers.

NPM Version Build Status Coverage Status

var ResilientMailer = require('resilient-mailer');
 
var provider; // email provider instance
 
var mailer = new ResilientMailer();
mailer.registerProvider(provider);

Description

resilient-mailer enables fault tolerance by allowing the registration of multiple email providers. Priority is the order in which they're registered. It tries to send the message using the first registered provider; if that fails, it then moves to the next one and tries with that. This process continues until the email has been successfully sent - or failed with all providers.

Installation

$ npm install resilient-mailer

Usage

Create an instance of the mailer:

var ResilientMailer = require('resilient-mailer');
 
var mailer = new ResilientMailer();

Register providers to it:

var provider; // email provider instance
mailer.registerProvider(provider);

Send messages:

var message = {
    from: 'no-reply@example.com',
    to: ['user@example.net'],
    subject: 'Testing my new email provider',
    textBody: 'Seems to be working!',
    htmlBody: '<p>Seems to be working!</p>'
};
 
mailer.send(message);

Testing

Install the development dependencies first:

$ npm install

Then the tests:

$ npm test

Providers

For any email service you want to use, you need to use a provider designed for use with it. This is a list of known providers:

Support

Please open an issue on this repository.

Authors

License

MIT licensed - see LICENSE file

Readme

Keywords

none

Package Sidebar

Install

npm i resilient-mailer

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • billinghamj