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

directus-extension-emailer

v1.1.0

Published

![Directus Mailer](/assets/banner.png)

Downloads

69

Readme

Directus Mailer

Directus eMailer 💬

An endpoint and a Flow Operation Node for sending emails with the Directus Nodemailer service. The Operation differs to the builtin operation in such a way, that it allows you to send emails with an attachment. Useful when you want to send invoices for example, which can be generated with my other Directus extension.

Setup

Install via the marketplace or locally.

Environment Variables

You can set the following environment variables to configure the email service. By default, the endpoint is not accepting connection from unauthenticated users, so you will need to set the EMAIL_ALLOW_GUEST_SEND variable to true if you want to allow guest sending (DANGEROUS! 🚨). Normally only admins can use the endpoint and the flow operation. Make sure to have the correct rights, or alternatively you can specify individual roles, who have access to the email service.

EMAIL_ALLOW_GUEST_SEND=false
EMAIL_ALLOWED_ROLES=COMMA_SEPARATED_LIST_OF_ROLES_UUIDS

Authentication

Requests made by unauthenticated users will be rejected. Requests must be made with a cookie or bearer token unless guest sending is active. See above.

Sending Notifications

An example POST request made to https://<directusAppDomain>/emailer In this example we are sending a test message to two recipients.

{
  "subject": "How cool is Directus?",
  "to": ["[email protected]", "[email protected]"],
  "template": {
    "name": "default-template",
  }
}

Liquid Templating 💧

You can build custom email templates with Liquid.js and add them to your extensions/templates folder to reference them as templates in your POST request. @email templating

If you're unfamiliar with Liquid, data can be referenced in a template with this interpolation{{title}} @data variables

{
  "from": "[email protected]",
  "to": "*********@gmail.com",
  "subject": "This email was made with Handlebars",
	"template" : {
    "name": "alert",
    "data" : {
      "title": "Im a title!",
      "subtitle": "Im a subtitle!",
      "body": "Im the body!"
	  }
  }
}

Attachments 📦

To add attachments in your email notification, include an array of attachment objects. @attachments

{
  "subject": "How cool is Directus?",
  "to": "[email protected]",
  "template": {
    "name": "default-template",
  }
  "attachments": [
    {
        "name": "image.png",
        "path": "./public/images/image.png"
    },
    {
      "name": "image_2.png",
      "path": "./public/images/image_2.png"
    }
  ]
}

Directus File Attachments

You can also include Directus files as attachments with an array of reference IDs. If the current user has permissions to view the file, then it will be attached to the email notification.

Note: Reference IDs that do not exist or do not meet the access requirements will be ignored.

{
  "subject": "How cool is Directus?",
  "to": "[email protected]",
  "template": {
    "name": "default-template",
  },
  "files":  [
	  "c17d967b-b257-414d-ab92-41ae6d0784ed",
		"b507c26f-1333-4a8a-b8df-9731be74542e"
	]
}

You can include both attachments and Directus files in your email notification.

{
  "subject": "How cool is Directus?",
  "to": "[email protected]",
  "template": {
    "name": "default-template",
  },
  "files":  [
	  "c17d967b-b257-414d-ab92-41ae6d0784ed",
	  "b507c26f-1333-4a8a-b8df-9731be74542e"
  ],
  "attachments": [
    {
      "filename": "text1.txt",
      "content": "hello world!"
    }
  ]
}

Acknowledgements

This repo was cloned from Directus eMailer and modified to support attachments and to add a Flow Operation Node. I also incorporated ui changes from https://github.com/nerkarso/directus-extensions/tree/master/operations/mailer.