diff --git a/src/emailer.js b/src/emailer.js index baa6bfe644..b0aad57d32 100644 --- a/src/emailer.js +++ b/src/emailer.js @@ -314,7 +314,10 @@ Emailer.sendToEmail = async (template, email, language, params) => { try { if (Plugins.hooks.hasListeners('filter:email.send')) { + // Deprecated, remove in v1.18.0 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 { await Emailer.sendViaFallback(data); } diff --git a/src/plugins/hooks.js b/src/plugins/hooks.js index 69381694ee..e481d9749c 100644 --- a/src/plugins/hooks.js +++ b/src/plugins/hooks.js @@ -8,6 +8,7 @@ const plugins = require('.'); const Hooks = module.exports; Hooks.deprecatedHooks = { + 'filter:email.send': 'static:email.send', // 👋 @ 1.18.0 'filter:router.page': 'response:router.page', // 👋 @ 2.0.0 };