nxus-mailer

4.0.0-2

Build Status

A Nxus module for sending emails through different services.

Installation

> npm install nxus-mailer --save

Usage

Register a mail service

mailer.service(myService)

Each service is expected to implement a method called sendMessage with the signature

sendMessage(to, from, subject, content, opts) {
...
}

Alternatively, you can specify an array of to addresses:

sendMessage([toAddress, toAddress2], from, subject, content, opts) {
...
}

Send an email using a service

mailer.send('to@address', 'from@address', "My subject", "Body content", {some: opts})

Opts

The opts hash can be used to send service specific opts back to the mail handler. For example:

// SendGrid opts
mailer.send('to@address', 'from@address', "My subject", "Body content", {html: "<p>Html content</p>"})
new Mailer()

Extends NxusModule

Instance Members
service(service)
send(to, from, subject, body, options, args)