@nxus/mailer

2.4.0-1 • Public • Published

@nxus/mailer

Build Status

A Nxus module for sending emails through different services.

Installation

> npm install @nxus/mailer --save

Usage

Register a mail service

app.get('mailer').service(myService)

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

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

Send an email using a service

app.get('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:

// Mandrill opts
app.get('mailer').send('to@address', 'from@address', "My subject", "Body content", { async: true })

API


Mailer

The main Mailer class.

service

Register a service. See MandrillService for an example.

Parameters

  • service function a Class or callable that implements a method called sendMessage.

MandrillSerivce

A default service for mailing with Mandrill.

Dependencies (6)

Dev Dependencies (8)

Package Sidebar

Install

npm i @nxus/mailer

Weekly Downloads

1

Version

2.4.0-1

License

MIT

Last publish

Collaborators

  • loppear
  • mjreich
  • nxus-admin