diff --git a/server/services/notifications.js b/server/services/notifications.js index 3ed340db9..06c911959 100644 --- a/server/services/notifications.js +++ b/server/services/notifications.js @@ -63,6 +63,11 @@ export default class Notifications { event.name === "documents.publish" ? "published" : "updated"; for (const setting of notificationSettings) { + // Suppress notifications for suspended users + if (setting.user.isSuspended) { + continue; + } + // For document updates we only want to send notifications if // the document has been edited by the user with this notification setting // This could be replaced with ability to "follow" in the future @@ -141,14 +146,19 @@ export default class Notifications { ], }); - notificationSettings.forEach((setting) => + notificationSettings.forEach((setting) => { + // Suppress notifications for suspended users + if (setting.user.isSuspended) { + return; + } + mailer.collectionNotification({ to: setting.user.email, eventName: "created", collection, actor: collection.user, unsubscribeUrl: setting.unsubscribeUrl, - }) - ); + }); + }); } }