diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 5894ff0784..78d5ef938e 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -92,8 +92,6 @@ function registerAndLoginUser(req, res, userData, callback) { user.deleteInvitation(userData.email); - user.notifications.sendWelcomeNotification(uid); - plugins.fireHook('filter:register.complete', {uid: uid, referrer: req.body.referrer || nconf.get('relative_path') + '/'}, next); } ], callback); diff --git a/src/user/approval.js b/src/user/approval.js index 0639286a67..a4a3981002 100644 --- a/src/user/approval.js +++ b/src/user/approval.js @@ -1,17 +1,16 @@ 'use strict'; -var async = require('async'), - nconf = require('nconf'), - request = require('request'), +var async = require('async'); +var request = require('request'); - db = require('../database'), - meta = require('../meta'), - emailer = require('../emailer'), - notifications = require('../notifications'), - groups = require('../groups'), - translator = require('../../public/src/modules/translator'), - utils = require('../../public/src/utils'); +var db = require('../database'); +var meta = require('../meta'); +var emailer = require('../emailer'); +var notifications = require('../notifications'); +var groups = require('../groups'); +var translator = require('../../public/src/modules/translator'); +var utils = require('../../public/src/utils'); module.exports = function(User) { @@ -90,9 +89,6 @@ module.exports = function(User) { emailer.send('registration_accepted', uid, data, next); }); }, - function(next) { - User.notifications.sendWelcomeNotification(uid, next); - }, function(next) { removeFromQueue(username, next); }, diff --git a/src/user/create.js b/src/user/create.js index d89d949912..b15226eba0 100644 --- a/src/user/create.js +++ b/src/user/create.js @@ -98,6 +98,9 @@ module.exports = function(User) { function(next) { groups.join('registered-users', userData.uid, next); }, + function(next) { + user.notifications.sendWelcomeNotification(uid, next); + }, function(next) { if (userData.email) { async.parallel([