npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nodemailer-courier-transport

v0.7.7

Published

Nodemailer + Courier

Readme

nodemailer-courier-transport

Setup

To set up the basic architecture so you can send Nodemailer emails via Courier, start with the following code

const nodemailer = require("nodemailer");

const courierTransport = require("nodemailer-courier-transport");

// This is your API key that you retrieve from courier.com account (free up to 10K monthly sends)

const auth = {
    apiKey: "ABCDEFGHIJKLMN",
};

const  nodemailerCourier  =  nodemailer.createTransport(courierTransport(auth));

Once this is set up, then you can set the various options available for your messaging and notifications using the SendMail function.

nodemailerCourier.sendMail(
{
  template:  "courier-template-id",  // Configured in Courier UI
  brand_id:  "courier-brand-id",  // Configured in Courier UI
  email:  "[email protected]",
},

(err,  info)  =>  {
  if (err) {
  console.log(`Error: ${err}`);
  }  else  {
  console.log(`Response: ${info}`);
  }
}

);

Recipients

There are multiple ways to send outbound. You can chain multiple types together too, so potential exists to send the same message to a unique email, a unique user and a list at the same time.

  • to an email
  • to a user_id inside Courier
  • to a list created inside Courier
  • to a list pattern
nodemailerCourier.sendMail(
  {
  to: "courier-user-id",  // Configured in Courier UI
  list_id:  "courier-list-id",  // Configured in Courier UI
  email:  "[email protected]",
  },
);

Dynamic data

Courier Notification that have dynamic data can be specified of the SendMail function. You need to pass the all the data types as a data object.

nodemailerCourier.sendMail(
  {
  email:  "[email protected]",
  data: {
    name: "Recipient Name",
    link:"https://www.courier.com/"
    }
  },
);

Template

Courier Notification templates can be set as part of the SendMail function. You should specify the unique template ID.

nodemailerCourier.sendMail(
  {
  template: "courier-template-id",  // Configured in Courier UI
  email:  "[email protected]",
  data: {
    name: "Recipient Name",
    link:"https://www.courier.com/"
    }
  },
);

Brand

Specifying a branded template design can be set as part of the SendMail function, referencing the Courier Notification brand ID. This will then be reflected across multiple templates being sent.

nodemailerCourier.sendMail(
  {
  brand: "courier-brand-id",  // Configured in Courier UI
  template: "courier-template-id",  // Configured in Courier UI
  email:  "[email protected]",
  data: {
    name: "Recipient Name",
    link:"https://www.courier.com/"
    }
  },
);

Overrides

The ability to override email base settings, whilst not having the fine grain control of provider based overrides, has been implemented.

These overrides cover:

  • message subject
  • message from - email
  • message bcc - email
  • message cc - email
  • message reply_to - email
nodemailerCourier.sendMail(
  {
  template: "courier-template-id",  // Configured in Courier UI
  email:  "[email protected]",
  data: {
    name: "Recipient Name",
    link:"https://www.courier.com/"
    }
  },
  override: {
    from: "[email protected]",
    reply_to: "[email protected]",
    subject: "Overridden Subject",
    bcc: "[email protected]",
    cc: "[email protected]",
  }
);

Email tracing

You can enable email tracing as part of the SendMail function, referencing the Courier Notification metadata tracing ID.

nodemailerCourier.sendMail(
  {
  template: "courier-template-id",  // Configured in Courier UI
  email:  "[email protected]",
  data: {
    name: "Recipient Name",
    link:"https://www.courier.com/"
    }
  },
  trace: "your-custom-trace-id"
);

Timeouts

Message timeouts can be set as part of the SendMail function. It requires a number amount in seconds.

nodemailerCourier.sendMail(
  {
  template: "courier-template-id",  // Configured in Courier UI
  email:  "[email protected]",
  data: {
    name: "Recipient Name",
    link:"https://www.courier.com/"
    }
  },
  timeout: 3600
);

Providers

You can send provider based overrides as an object to the SendMail function, allowing you to do domain specific variations as part of the messaging cycle.

As this is provider based overrides, please consult the Courier docs directly on this. This plugin aims to provide coverage for all the Courier messaging feature set, not replace it.

Plugin development

There is a long term plan to move this to Typescript and use type validation using Zod to help gracefully manage input