Skip to content

Node.js based forum software built for the modern web

fix: deprecated emailer hook

Julian Lam565ca3cc3b78
diff --git a/test/api.js b/test/api.js
index de94973086..e3d420c83a 100644
--- a/test/api.js
+++ b/test/api.js
@@ -175,7 +175,7 @@ describe('API', async () => {
after(async () => {
plugins.hooks.unregister('core', 'filter:search.query', dummySearchHook);
- plugins.hooks.unregister('emailer-test', 'filter:email.send');
+ plugins.hooks.unregister('emailer-test', 'static:email.send');
});
async function setupData() {
@@ -306,7 +306,7 @@ describe('API', async () => {
});
// Attach an emailer hook so related requests do not error
plugins.hooks.register('emailer-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method: dummyEmailerHook,
});
diff --git a/test/authentication.js b/test/authentication.js
index 12afc00c15..8f0ba9389c 100644
--- a/test/authentication.js
+++ b/test/authentication.js
@@ -26,7 +26,7 @@ describe('authentication', () => {
before((done) => {
// Attach an emailer hook so related requests do not error
plugins.hooks.register('authentication-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method: dummyEmailerHook,
});
@@ -39,7 +39,7 @@ describe('authentication', () => {
});
after(() => {
- plugins.hooks.unregister('authentication-test', 'filter:email.send');
+ plugins.hooks.unregister('authentication-test', 'static:email.send');
});
it('should allow login with email for uid 1', async () => {
diff --git a/test/controllers.js b/test/controllers.js
index 4c73fa8211..82e517640a 100644
--- a/test/controllers.js
+++ b/test/controllers.js
@@ -346,7 +346,7 @@ describe('Controllers', () => {
before(async () => {
// Attach an emailer hook so related requests do not error
plugins.hooks.register('emailer-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method: dummyEmailerHook,
});
@@ -361,7 +361,7 @@ describe('Controllers', () => {
after(() => {
meta.config.requireEmailAddress = 0;
- plugins.hooks.unregister('emailer-test', 'filter:email.send');
+ plugins.hooks.unregister('emailer-test', 'static:email.send');
});
it('email interstitial should still apply if empty email entered and requireEmailAddress is enabled', async () => {
diff --git a/test/emailer.js b/test/emailer.js
index 28daa896af..35f82b0ecc 100644
--- a/test/emailer.js
+++ b/test/emailer.js
@@ -58,14 +58,14 @@ describe('emailer', () => {
};
Plugins.hooks.register('emailer-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method,
});
Emailer.sendToEmail(template, email, language, params, (err) => {
assert.equal(err, error);
- Plugins.hooks.unregister('emailer-test', 'filter:email.send', method);
+ Plugins.hooks.unregister('emailer-test', 'static:email.send', method);
done();
});
});
@@ -157,14 +157,14 @@ describe('emailer', () => {
assert(false); // if thrown, email was sent
};
Plugins.hooks.register('emailer-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method,
});
await user.bans.ban(recipientUid);
await Emailer.send('test', recipientUid, {});
- Plugins.hooks.unregister('emailer-test', 'filter:email.send', method);
+ Plugins.hooks.unregister('emailer-test', 'static:email.send', method);
});
it('should return true if the template is "banned"', async () => {
@@ -172,12 +172,12 @@ describe('emailer', () => {
assert(true); // if thrown, email was sent
};
Plugins.hooks.register('emailer-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method,
});
await Emailer.send('banned', recipientUid, {});
- Plugins.hooks.unregister('emailer-test', 'filter:email.send', method);
+ Plugins.hooks.unregister('emailer-test', 'static:email.send', method);
});
it('should return true if system settings allow sending to banned users', async () => {
@@ -185,7 +185,7 @@ describe('emailer', () => {
assert(true); // if thrown, email was sent
};
Plugins.hooks.register('emailer-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method,
});
@@ -194,7 +194,7 @@ describe('emailer', () => {
meta.config.sendEmailToBanned = 0;
await user.bans.unban(recipientUid);
- Plugins.hooks.unregister('emailer-test', 'filter:email.send', method);
+ Plugins.hooks.unregister('emailer-test', 'static:email.send', method);
});
});
});
diff --git a/test/flags.js b/test/flags.js
index 914e9ae72a..65dd23ef66 100644
--- a/test/flags.js
+++ b/test/flags.js
@@ -35,7 +35,7 @@ describe('Flags', () => {
const dummyEmailerHook = async (data) => {};
// Attach an emailer hook so related requests do not error
plugins.hooks.register('flags-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method: dummyEmailerHook,
});
@@ -70,7 +70,7 @@ describe('Flags', () => {
});
after(() => {
- plugins.hooks.unregister('flags-test', 'filter:email.send');
+ plugins.hooks.unregister('flags-test', 'static:email.send');
});
describe('.create()', () => {
diff --git a/test/socket.io.js b/test/socket.io.js
index 54568b47e0..f9b8b677df 100644
--- a/test/socket.io.js
+++ b/test/socket.io.js
@@ -236,12 +236,12 @@ describe('socket.io', () => {
before(() => {
// Attach an emailer hook so related requests do not error
plugins.hooks.register('emailer-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method: dummyEmailerHook,
});
});
after(() => {
- plugins.hooks.unregister('emailer-test', 'filter:email.send');
+ plugins.hooks.unregister('emailer-test', 'static:email.send');
});
it('should validate emails', (done) => {
diff --git a/test/user.js b/test/user.js
index 6133f14f82..907a43f388 100644
--- a/test/user.js
+++ b/test/user.js
@@ -38,7 +38,7 @@ describe('User', () => {
before((done) => {
// Attach an emailer hook so related requests do not error
plugins.hooks.register('emailer-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method: dummyEmailerHook,
});
@@ -56,7 +56,7 @@ describe('User', () => {
});
});
after(() => {
- plugins.hooks.unregister('emailer-test', 'filter:email.send');
+ plugins.hooks.unregister('emailer-test', 'static:email.send');
});
beforeEach(() => {
diff --git a/test/user/emails.js b/test/user/emails.js
index 9ea19e3a01..6afbfc8023 100644
--- a/test/user/emails.js
+++ b/test/user/emails.js
@@ -23,7 +23,7 @@ describe('email confirmation (library methods)', () => {
before(() => {
// Attach an emailer hook so related requests do not error
plugins.hooks.register('emailer-test', {
- hook: 'filter:email.send',
+ hook: 'static:email.send',
method: dummyEmailerHook,
});
});
@@ -36,7 +36,7 @@ describe('email confirmation (library methods)', () => {
});
after(async () => {
- plugins.hooks.unregister('emailer-test', 'filter:email.send');
+ plugins.hooks.unregister('emailer-test', 'static:email.send');
});
describe('isValidationPending', () => {