Closed philipmjohnson closed 6 years ago
How to not spam the user.
First, allow the user to specify the maximum number of "notification deliveries", either once per hour or once per day. If once a day, you get a notification of what happened during the previous 24 hours at 6:00am. (In the event that something actually happened.)
Second, one of your cron job wakes up every X minutes, and adds a document to the "notification" collection if something of interest occurred. The notification collection has a timestamp, a username (indicating who cares about this specific notification), a notification type, and notification data. Also a field called "delivered".
Third, you have another cron job that wakes up once per hour on the hour. And a fourth cron job that wakes up once per day at 6:00am. These cron jobs first find the users they care about, then they do a search in the Notifications collection for any notifications that occured for that user during the appropriate prior time interval. If there are any, then they send the associated message.
Fourth, we need a new page (or maybe component on the profile page) that lists the notifications for this user (say, for the past week).
The email or text message could contain a link to the profile page in emilia where they could go look for more details.
Please do work for this task in a branch called issue-143.