This is a plugin to mail with Hemera

Usage no npm install needed!

<script type="module">
  import hemeraMail from 'https://cdn.skypack.dev/hemera-mail';


Hemera-mail package

npm styled with prettier

This is a plugin to mail via SMTP in Hemera. It's use Nodemailer as client library. The parameters are passed one-to-one so look in the nodemailer documentation if you want to configure something.


const hemera = new Hemera(nats)
hemera.use(require('hemera-mail'), {
  transport: // use here the nodemailer transport plugin of your choice, default is jsonTransport


  • Node.js 6+

How to add attachments ?

As long as your content TEXT, HTML is very small (A typical 80-word plain text message is around 10 KB.) it's no problem to transfer it over NATS. Transfering big files in a distributed system is in general an anti-pattern because it will affect the latency of your network and can result in cascading failures. In practice, we recommend to create an API Gateway which is responsible to handle file uploads. The files can be stored in a distributed object storage like Amazon S3 or opensource alternatives Rook, Minio. The developer should only work with ID's or Url's.

Lots of mail services are providing an interface to manage email templates this is a great feature because you don't have to send the template on every mail in line with the motto "Buy it and stick to your business".