0.1.0 • Public • Published


A RESTful service for sending templated e-mails upon request

Get Started

  1. Install with: npm i -g --no-optional mailgirl.
  2. Point MAILGIRL_CONF env var to a TOML config file.
  3. Drop your EJS templates in a folder.
  4. Write your SMTP settings in the config file from previous step.
  5. Run in the terminal with: mailgirl.

Get Started with Docker

The official image repository in Docker Hub is gcsboss/mailgirl.

Run like this: docker run -p 10080:80 -v /your/conf.toml:/usr/src/app/conf.toml -v /your/templates:/usr/src/app/templates gcsboss/mailgirl

Available Settings

templatesDir = './templates'
port = 80
level = 'info'
file = './maigirl.log'
host = ''
port = 587
secure = true
user = ''
pass = 'my-example-password'

API Usage

  • POST /preview/:template-path: Responds with the raw e-mail that would be sent.
  • POST /mail/:template-path: Actually sends the e-mail to the setup SMPT server.

The request body needs to be a JSON whose keys will be available for the given template to work with.

Templates Definition

The EJS e-mail templates must consist of the following parts:

  • First line: Subject
  • Second line: From (allow quoted naming)
  • Third line: To (allow comma separated lists)
  • Rest of the lines: The atcual e-mail body

Reporting Bugs

If you have found any problems with this module, please:

  1. Open an issue.
  2. Describe what happened and how.
  3. Also in the issue text, reference the label ~bug.

We will make sure to take a look when time allows us.

Proposing Features

If you wish to get that awesome feature or have some advice for us, please:

  1. Open an issue.
  2. Describe your ideas.
  3. Also in the issue text, reference the label ~proposal.


If you have spotted any enhancements to be made and is willing to get your hands dirty about it, fork us and submit your merge request so we can collaborate effectively.

Package Sidebar


npm i mailgirl

Weekly Downloads






Unpacked Size

14.9 kB

Total Files


Last publish


  • gcsboss