Skip to content

Commit

Permalink
feat: new hook static:email.send
Browse files Browse the repository at this point in the history
deprecates filter:email.send
  • Loading branch information
julianlam committed Feb 25, 2021
1 parent 0dad568 commit bf90d15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/emailer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions src/plugins/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit bf90d15

Please sign in to comment.