-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Batch email notifications to prevent email flooding #132
Comments
In our Weekly GSoC Meeting, I and @Dhanus3133 discussed this issue. Dhanus proposed this prototype for implementing this feature. We brainstormed the following implementation in the meeting:
|
@nemesifier this may lead to a user never receiving a notification, if the system manages to generate atleast one notification in the 30 minutes interval. Maybe, we can implement some kind of backoff? E.g. first batch notification is sent at 30 minutes, second after 60 minutes from the last one and so on. I think, 30 minutes is a good cooldown time for batching. We may not even need to implement the backoff mechanism. |
Thinking out loud We should not include all the notification in the email because it may lead to a very long email. Maybe, we should should show only 10 notifications in the email like in the shared screenshot and provide a URL in the end "view all notifications". We should show the correct number of notifications in the email though. |
By this, we will send the emails to all the messages created recently, but we should also validate the user If these must be even validated then I think of two different approaches we can use.
Let me know which one suits good. |
I don't think we need to verify email preference again in the task. We are already doing it in the |
Doesn't this cause an issue when we have it for two different organizations with different email preferences as we only filter it by recipient_id and not by org. |
A really good catch @Dhanus3133 👏🏼 I think, we can store the notification IDs in the cache as you proposed then. |
Implements and closes #132. --------- Co-authored-by: Federico Capoano <f.capoano@openwisp.io> Co-authored-by: Gagan Deep <pandafy.dev@gmail.com>
Implements and closes #132. --------- Co-authored-by: Federico Capoano <f.capoano@openwisp.io> Co-authored-by: Gagan Deep <pandafy.dev@gmail.com>
Whenever there are infrastructure issues that cause lots of alerts, email boxes start to refuse receiving alert emails, which raise errors but is also bad because the email address sending the alerts could be flagged as spam.
The solution for this problem is to add the possibility to batch emails in a way that if there are more than X emails to the same user in less than X minutes, the subsequent emails get batched so they don't get sent singularly but rather summarized in a single email sent after the situation cools off (say X minutes after the user is not receiving emails).
A default configuration could be as follows:
It's just an idea for now, we can improve it further.
A good example of an open source application which does this is sentry:
The text was updated successfully, but these errors were encountered: