Skip to content

About

Seneca email plugin

Resources

Code of conduct

Stars

10 stars

Watchers

5 watching

Forks

Repository files navigation

@seneca/mail

npm version build Known Vulnerabilities Coverage Status DeepScan grade

Voxgig This open source module is sponsored and supported by Voxgig.

Install

npm install seneca@^4 @seneca/entity @seneca/mail

Requires Node.js 24 or later and Seneca 4. The mail history (option history, on by default) is saved as sys/mailhist entities, so it needs @seneca/entity 29 or later and a store. @seneca/entity loads its in-memory store by default.

Quick Example

seneca
  .use('@seneca/entity')
  .use('@seneca/mail', {
    email: { send: true }
  })

More Examples

See test/ for usage examples.

Motivation

Send emails with templates from Seneca microservices.

Support

If you're using this module and need help, you can:

API

Options

  • test : boolean false : Test mode.
  • history : boolean true : Save mail history to sys/mailhist entity.
  • makehist : function : Add properties to sys/mailhist entity.
  • logmail : boolean true : Log mail sending at info level.
  • email.send : boolean false : Send email (for safety, off by default).
  • email.preview : boolean false : Preview email.

Set plugin options when loading with:

seneca.use('mail', { name: value, ... })

Note: foo.bar in the list above means { foo: { bar: ... } }

Other email options are passed to email-templates and nodemailer, for example email.message for default message fields, or email.transport as { name, options }, which loads the transport package nodemailer-<name>.

Action Patterns

Action Descriptions

« sys:mail,hook:render »

No description provided.


« sys:mail,send:mail »

No description provided.


Contributing

The [Senecajs org][] encourages open participation. If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.

Running tests

npm run test

Background

Supports multiple email transports via nodemailer.

About

Seneca email plugin

Resources

Code of conduct

Stars

10 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages