resilient-mailer-mandrill
resilient-mailer-mandrill
implements Mandrill as an email provider for
resilient-mailer
.
var MandrillProvider = ; var mandrill = 'MyApiKey'; var mailer; // ResilientMailer instancemailer;
Installation
$ npm install resilient-mailer-mandrill
Usage
Create an instance of the provider. There are also a number of options you can alter:
var MandrillProvider = ; var options = ipPool: '192.0.2.23' // see: http://help.mandrill.com/entries/24182062 async: true // see 'async' field: https://mandrillapp.com/api/docs/messages.html#method-send apiSecure: false // allows the use of HTTP rather than HTTPS apiHostname: '127.0.0.1' // allows alternative hostname apiPort: 8080 // allows unusual ports; var mandrill = 'MyApiKey' options;
To register the provider with your ResilientMailer
instance:
var mailer; // ResilientMailer instancemailer;
In the event that you want to use MandrillProvider
directly (rather than the
usual way - via ResilientMailer
):
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>'; mandrill;
To see everything available in the message
object, refer to
resilient-mailer.
Testing
Install the development dependencies first:
$ npm install
Then the tests:
$ npm test
Support
Please open an issue on this repository.
Authors
- James Billingham james@jamesbillingham.com
License
MIT licensed - see LICENSE file