wejsv2old-send-email
v0.2.3
Published
Npm package to send emails with sails.js used on We.js v2
Downloads
3
Readme
we-send-email
Npm package and Sails hook to send emails with sails.js used on We.js
With node nodemailer
and email-templates
How to install
npm install we-send-email --save
And add it in one sails.js hook:
file: api/hooks/email/index.js
module.exports = require('we-send-email').hook;
Usage
var options = {};
// to email
options.email = '[email protected]';
// sender email
options.from = '[email protected]';
// see https://github.com/niftylettuce/node-email-templates
vat templateName = 'myEmailTemplate';
// some variables to send to you template
var templateVariables = {
user: {
name: 'Hihiohir'
},
site: {
name: 'WE',
slogan: 'MIMI one slogan variable here'
}
};
sails.email.sendEmail(options ,templateName ,templateVariables, cb);
Configuration
the config file is [project]/config/email.js
See:
- https://github.com/andris9/Nodemailer
- https://github.com/wejs/we
Credits
LICENSE: MIT