Skip to content

Instantly share code, notes, and snippets.

@ImreC
ImreC / notifier.js
Last active February 17, 2018 19:40
module.exports = function(app) {
function getLink(type, hash) {
const url = 'http://localhost:3030/' + type + '?token=' + hash
return url
}
function sendEmail(email) {
return app.service('mailer').create(email).then(function (result) {
console.log('Sent email', result)
// Initializes the `authmanagement` service on path `/authmanagement`
const authManagement = require('feathers-authentication-management');
const hooks = require('./authmanagement.hooks');
const notifier = require('./notifier');
module.exports = function (app) {
// Initialize our service with any options it requires
app.configure(authManagement(notifier(app)));
// Initializes the `/mailer` service on path `/mailer`
const hooks = require('./mailer.hooks');
const Mailer = require('feathers-mailer');
const smtpTransport = require('nodemailer-smtp-transport');
module.exports = function (app) {
app.use('/mailer', Mailer(smtpTransport({
host: 'email-smtp.us-east-1.amazonaws.com',
secure: true,
auth: {
0x5ad29c5eFf82dAB06267F44c7Ef1864004A7605e