From 94275c1cc279f68f4c023afc2c68feb70d3ddb84 Mon Sep 17 00:00:00 2001 From: Alejo Thomas Ortega Date: Mon, 26 Aug 2024 16:31:39 -0300 Subject: [PATCH 1/2] docs: about how to prevent sending certain notifications type through email --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 9ccb360a..28c80a2a 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,12 @@ sequenceDiagram > If the email sent in the `PUT /set-email` request is an empty string, the email will be removed from the subscription and email notifications will be > deactivated for the user. +### Prevent sending emails for certain type of notifications +Currently, the service broadcasts notifications both via email and in-world inboxes. Whenever a new notification is added, the service attempts to deliver it through both channels. However, certain notifications should be broadcasted exclusively in-world to avoid cluttering users’ email inboxes. + +The service will attempt to send email notifications if a corresponding template is available in the `processor/src/adapters/email-templates/` directory. To prevent a notification from being sent via email and only broadcast it in-world, simply avoid adding or remove the email template for that notification from this directory. + +Additionally, the service tests must be adjusted since they automatically check for a matching template for every notification type. For notifications intended to be broadcasted only in-world, it is needed to exclude them from the test suite located at `/processor/test/unit/adapters/email-renderer.spec.ts`, as has already been done for the `BADGE_GRANTED` notification type. # Run locally From 2ee296bcda3df615c70adee9019d57298d2b1579 Mon Sep 17 00:00:00 2001 From: Alejo Thomas Ortega Date: Mon, 26 Aug 2024 16:50:49 -0300 Subject: [PATCH 2/2] apply PR feedback --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28c80a2a..eb6e163a 100644 --- a/README.md +++ b/README.md @@ -204,11 +204,11 @@ sequenceDiagram > deactivated for the user. ### Prevent sending emails for certain type of notifications -Currently, the service broadcasts notifications both via email and in-world inboxes. Whenever a new notification is added, the service attempts to deliver it through both channels. However, certain notifications should be broadcasted exclusively in-world to avoid cluttering users’ email inboxes. +Currently, the service broadcasts notifications both via email and in-world/in-app inbox. Whenever a new notification is added, the service attempts to deliver it through both channels. However, certain notifications should be broadcast exclusively in-world to avoid cluttering users' email inboxes. The service will attempt to send email notifications if a corresponding template is available in the `processor/src/adapters/email-templates/` directory. To prevent a notification from being sent via email and only broadcast it in-world, simply avoid adding or remove the email template for that notification from this directory. -Additionally, the service tests must be adjusted since they automatically check for a matching template for every notification type. For notifications intended to be broadcasted only in-world, it is needed to exclude them from the test suite located at `/processor/test/unit/adapters/email-renderer.spec.ts`, as has already been done for the `BADGE_GRANTED` notification type. +Additionally, the service tests must be adjusted since they automatically check for a matching template for every notification type. For notifications intended to be broadcast only in-world, they must be excluded from `/common/src/types.ts` and the test suite located at `/processor/test/unit/adapters/email-renderer.spec.ts`, as has already been done for the `BADGE_GRANTED` notification type. # Run locally