I want to allow my users to opt-out of certain email notifications. I'm trying to decide how to implement this in the database. I've already got a set of Users
and all the emails are stored as EmailTemplates
which have a unique key. So I figure a simple m2m table with users/emails would work well.
However, should I (1) populate this table with all user/email combinations every time a user is created (may complicate things when a new email is added?) so that by default they're opted into everything, or should I (2) do it backwards and say if there is no entry for this user/email pair do send the email? Then the preferences table kind of becomes a BlockEmailNotification
table.
Thoughts?