mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-03 13:19:51 +01:00
feat: new hook static:email.send
deprecates filter:email.send
This commit is contained in:
@@ -314,7 +314,10 @@ Emailer.sendToEmail = async (template, email, language, params) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (Plugins.hooks.hasListeners('filter:email.send')) {
|
if (Plugins.hooks.hasListeners('filter:email.send')) {
|
||||||
|
// Deprecated, remove in v1.18.0
|
||||||
await Plugins.hooks.fire('filter:email.send', data);
|
await Plugins.hooks.fire('filter:email.send', data);
|
||||||
|
} else if (Plugins.hooks.hasListeners('static:email.send')) {
|
||||||
|
await Plugins.hooks.fire('static:email.send', data);
|
||||||
} else {
|
} else {
|
||||||
await Emailer.sendViaFallback(data);
|
await Emailer.sendViaFallback(data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const plugins = require('.');
|
|||||||
const Hooks = module.exports;
|
const Hooks = module.exports;
|
||||||
|
|
||||||
Hooks.deprecatedHooks = {
|
Hooks.deprecatedHooks = {
|
||||||
|
'filter:email.send': 'static:email.send', // 👋 @ 1.18.0
|
||||||
'filter:router.page': 'response:router.page', // 👋 @ 2.0.0
|
'filter:router.page': 'response:router.page', // 👋 @ 2.0.0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user