-
-
Notifications
You must be signed in to change notification settings - Fork 0
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: Email Notifications #9
Comments
Will discuss on this in a bit, but mostly sounds good. |
Not critical but we could generate something like that for each user. Given it would only unsubscribe them it doesn't need to be crazy secure. Q. Would settings apply to all notifications or just a single thread? Eg. muting a thread doesn't mean I would necessarily not want to get any notifications. Would that user then be popped off the relevant subscription? Q. Wondering whether the queue table is directly relevant; surely certain events would trigger a notification, and with these events any subscribers would be notified -- or is ur feeling here that if it's dealt with in the Not sure if I see the value of the settings table, except for extensibility. |
Agreed
A row in
Yes, I think it's too much work for the server thread. Think about what happens when you as a user have to wait for 100 emails to fire off because you posted a comment in a popular thread.
Weeelll, the strength of this approach is that we don't need to do database migrations/schema modifications in order to add new settings to the table - just update the code and the same table handles any new settings. |
Feature
A basic MVP email notification system would provide groundwork for a richer site experience and higher user engagement.
Email notifications draw existing users back to the site.
Infrastructure required for email notifications can be used for on-site popup notifications, notification feed, notification options including opt-in/opt-outs, subscribe (or 'watch') to a thread etc...
For MVP I propose default email notifications for the following events:
With a single option in the Profile view to turn off all email notifications (and probably a link in each email to unsubscribe which has the same functionality.)
Implementation
This design is primarily based off this quora answer.
We need several new tables:
subscriptions
table that associates user IDs with objects that can be subscribed to - for MVP this would be questions and reviews.queue
table whose ORM implements a notification queue with 'push' and 'pop' operations (possibly a bit more granular than this...)settings
table for storing notification preferences and other settings for each user. Pros and cons of different schemas for this are discussed here. I think the 'property bag' method is the way to go - aka a row for each setting for each user (max_num_rows = num_users * num_settings). We'll probably be changing the notification settings a lot, so using this method keeps the system flexible. In order to make best use of this we'll need well-defined defaults for each setting, so a missing association between a user and a given setting means 'use the default'.On posting a new comment, the
subscriptions
table is queried for all users subscribing to the relevant question/review, then notifications for each user (including all information needed to send the notification) would be pushed to thequeue
table.An email daemon (a separate nodejs process) periodically 'pop's notifications off the
queue
table and sends out emails. (The daemon would first check thesettings
table for the user)I'm not sure what the best way to implement the in-email 'unsubscribe' button is - maybe there should be an 'unsubscribe' token in the database somewhere (user table?) which is part of the 'unsubscribe' link and clicking it sends the token, which gets checked by the backend for verification...?
The text was updated successfully, but these errors were encountered: