we-send-email

0.2.3 • Public • Published

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 = 'contato@albertosouza.net';
// sender email
options.from = 'Sender@host.net';
 
// 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:

Credits

Alberto Souza

LICENSE: MIT

Readme

Keywords

none

Package Sidebar

Install

npm i we-send-email

Weekly Downloads

1

Version

0.2.3

License

ISC

Last publish

Collaborators

  • albertosouza