Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-templater-mailer-microservice

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-templater-mailer-microservice

A microservice for sending template based emails via an SMTP server written in JavaScript

  • 0.0.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

node-templater-mailer-microservice

Build Status

A microservice for sending template based emails via an SMTP server written in JavaScript

Setup

npm install

Configuration

Copy config.json to config.local.json and adapt to your needs

Run

node main.js | ./node_modules/bunyan/bin/bunyan

Init configuration

Create the template foo:

curl -v -X PUT http://127.0.0.1:3000/templates/foo \
-H 'Content-Type: application/vnd.node-templater-mailer-microservice.v1+json; charset=utf-8' \
--data '{"subject":"Mail for <%= name %>","html":"Hello <%= name %>"}'

Create the SMTP transport bar:

curl -v -X PUT http://127.0.0.1:3000/smtp_credentials/bar \
-H 'Content-Type: application/vnd.node-templater-mailer-microservice.v1+json; charset=utf-8' \
--data '{"dsn":"smtp://john:doe@example.com:25","email":"info@example.com","name":"Example Inc."}'

Send an email using the transport bar and the template foo:

curl -v -X POST http://127.0.0.1:3000/send/bar/foo \
-H 'Content-Type: application/vnd.node-templater-mailer-microservice.v1+json; charset=utf-8' \
--data '{"to":"john.doe@example.com","name":"John Doe"}'

The subject and the html part of the template will be parsed through lodash's template function with the data provided in the body of this request.

Keywords

FAQs

Package last updated on 20 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc