New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mail-merger

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mail-merger

Tool of mail merge, which takes {{mustache}} email templates and data from json or csv to generate and bulk send emails

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-77.78%
Maintainers
1
Weekly downloads
 
Created
Source

mail-merger

NPM version Downloads

Tool of mail merge, which takes {{mustache}} email templates and data from json or csv to generate and bulk send emails.

Features

  • Generates emails from html templates based on handlebars
  • Sends emails via NodeMailer
  • Parse data defined in csv file and/or json as the context of emails
  • Merge/combine multiple lines of rows in csv into one big record with array properties
  • Use in your scripts and/or CLI
  • Supports .env file for security related settings (i.e. SMTP connection url with your username & password)

Installation

npm install mail-merger --save

Usage

CLI

## use `mail-merger --help` for more details
$ mail-merger -c=./data.csv -t=./sample.html -a=./img1.png -a=./img2.png

API

import { MailMerger } from 'mail-merger';

// refer to `defaults.ts` for all details of the options
const merger = new MailMerger(opts);
// refer to `mail-merger.spec.ts` for more details
const summary = await merger.send(context, template, mailOpts);

console.info(`[${summary.sent}] out of [${summary.total}] emails were sent out successfully!`);
NOTE

Please ensure change smtps variable to your SMTP settings prior running tests

Example

Please refer to the test files cli.spec.ts and mail-merger.spec.ts in the source code

License

MIT

Keywords

FAQs

Package last updated on 29 Apr 2020

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