Added email templating, and user welcome email
This commit is contained in:
@ -4,6 +4,7 @@ import bcrypt from 'bcrypt';
|
||||
import uuid from 'uuid';
|
||||
import { DataTypes, sequelize, encryptedFields } from '../sequelize';
|
||||
import { uploadToS3FromUrl } from '../utils/s3';
|
||||
import mailer from '../mailer';
|
||||
|
||||
import JWT from 'jsonwebtoken';
|
||||
|
||||
@ -99,5 +100,6 @@ const hashPassword = function hashPassword(model) {
|
||||
User.beforeCreate(hashPassword);
|
||||
User.beforeUpdate(hashPassword);
|
||||
User.beforeCreate(setRandomJwtSecret);
|
||||
User.afterCreate(user => mailer.welcome(user.email));
|
||||
|
||||
export default User;
|
||||
|
Reference in New Issue
Block a user