resilient-mailer
v0.1.1
Published
Provides fault-tolerant email delivery
Downloads
2
Readme
resilient-mailer
resilient-mailer
provides fault-tolerant email delivery, using failover email
providers.
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: '[email protected]',
to: ['[email protected]'],
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
- James Billingham [email protected]
License
MIT licensed - see LICENSE file