canner-mailer

0.1.0 • Public • Published

canner-mailer

Install

$ npm install -g canner-mailer

Usage

canner-mailer [options] <subject> <from> <user_json> <template_dir>

Example:

$ canner-mailer "canner推出新版" "canner團隊<non-reply@canner.io>" user.json ../email-templates/update-version/

user_json

email property is required, and you can add more props which you used in hbs template,

for example,

[
  {"email": "user@domain.com", "username": "test"} 
]

module require

var Mailer = require('../index');
var options = {
  transport: {
    type: "default" // support other types such as Gmail, SES...
    // add user, pass for Gmail 
    // add accessKeyId, secretAccessKey for SES
  }
};
 
var mailer = new Mailer(options);
 
// send to a user group with hbs template
mailer.gsend('non-reply@canner.io', users, subject, template_dir)
  .then(function() {
 
  })
  .catch(function(error) {
    console.log(error);
  });

Package Sidebar

Install

npm i canner-mailer

Weekly Downloads

13

Version

0.1.0

License

none

Last publish

Collaborators

  • wwwy3y3
  • chihsuan