Package Exports
- nxus-mailer
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nxus-mailer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
nxus-mailer
Table of Contents
Mailer
Extends NxusModule
A Nxus module for sending emails through different services.
Installation
> npm install nxus-mailer --saveUsage
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>"})service
Register a service. See SendgridService for an example.
Parameters
servicefunction a Class or callable that implements a method calledsendMessage.
send
Sends an email. Should be overridden by the sending service, but generally will take the following parameters