mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
closes #3644
This commit is contained in:
@@ -23,7 +23,7 @@ dashboardController.get = function(req, res, next) {
|
||||
notDoneText:'Reload required'
|
||||
},
|
||||
{
|
||||
done: plugins.hasListeners('action:email.send'),
|
||||
done: plugins.hasListeners('filter:email.send'),
|
||||
doneText: 'Emailer Installed',
|
||||
notDoneText:'Emailer not installed',
|
||||
tooltip:'Install an emailer plugin from the plugin page in order to activate registration emails and email digests',
|
||||
|
||||
@@ -79,7 +79,7 @@ Controllers.reset = function(req, res, next) {
|
||||
Controllers.login = function(req, res, next) {
|
||||
var data = {},
|
||||
loginStrategies = require('../routes/authentication').getLoginStrategies(),
|
||||
emailersPresent = plugins.hasListeners('action:email.send');
|
||||
emailersPresent = plugins.hasListeners('filter:email.send');
|
||||
|
||||
var registrationType = meta.config.registrationType || 'normal';
|
||||
|
||||
|
||||
@@ -74,8 +74,8 @@ var fs = require('fs'),
|
||||
|
||||
callback = callback || function() {};
|
||||
|
||||
if (!Plugins.hasListeners('action:email.send')) {
|
||||
winston.warn('[emailer] No active email plugin found!');
|
||||
if (!Plugins.hasListeners('filter:email.send')) {
|
||||
winston.warn('[emailer] No active email plugin found to send "' + template + '" email');
|
||||
return callback();
|
||||
}
|
||||
|
||||
@@ -110,11 +110,10 @@ var fs = require('fs'),
|
||||
pid: params.pid,
|
||||
fromUid: params.fromUid
|
||||
};
|
||||
Plugins.fireHook('filter:email.send', data, next);
|
||||
Plugins.fireHook('filter:email.modify', data, next);
|
||||
},
|
||||
function (data, next) {
|
||||
Plugins.fireHook('action:email.send', data);
|
||||
next();
|
||||
Plugins.fireHook('filter:email.send', data, next);
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -198,12 +198,11 @@ SocketAdmin.settings.clearSitemapCache = function(socket, data, callback) {
|
||||
};
|
||||
|
||||
SocketAdmin.email.test = function(socket, data, callback) {
|
||||
if (plugins.hasListeners('action:email.send')) {
|
||||
if (plugins.hasListeners('filter:email.send')) {
|
||||
emailer.send(data.template, socket.uid, {
|
||||
subject: '[NodeBB] Test Email',
|
||||
site_title: meta.config.title || 'NodeBB'
|
||||
});
|
||||
callback();
|
||||
}, callback);
|
||||
} else {
|
||||
callback(new Error('[[error:no-emailers-configured]]'));
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ var async = require('async'),
|
||||
return winston.verbose('[user/jobs] Did not send digests (' + interval + ') because subscription system is disabled.');
|
||||
}
|
||||
|
||||
if (!plugins.hasListeners('action:email.send')) {
|
||||
if (!plugins.hasListeners('filter:email.send')) {
|
||||
return winston.error('[user/jobs] Did not send digests (' + interval + ') because no active email plugin was found.');
|
||||
}
|
||||
|
||||
|
||||
@@ -80,11 +80,8 @@ var async = require('async'),
|
||||
if (plugins.hasListeners('action:user.verify')) {
|
||||
plugins.fireHook('action:user.verify', {uid: uid, data: data});
|
||||
next();
|
||||
} else if (plugins.hasListeners('action:email.send')) {
|
||||
emailer.send('welcome', uid, data, next);
|
||||
} else {
|
||||
winston.warn('No emailer to send verification email!');
|
||||
next();
|
||||
emailer.send('welcome', uid, data, next);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -43,12 +43,7 @@ module.exports = function(User) {
|
||||
template: 'invitation'
|
||||
};
|
||||
|
||||
if (plugins.hasListeners('action:email.send')) {
|
||||
emailer.sendToEmail('invitation', email, meta.config.defaultLang, data, next);
|
||||
} else {
|
||||
winston.warn('No emailer to send verification email!');
|
||||
next();
|
||||
}
|
||||
});
|
||||
}
|
||||
], callback);
|
||||
|
||||
Reference in New Issue
Block a user