0.1.0 • Published 9 years ago
canner-mailer v0.1.0
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);
});