XF 1.5 Query to Set Alert Preferences in "alert_optout" ??

king8084

Well-known member
Please feel free to delete my previous thread, as I'm looking for a more general solution at this point..


Alert preferences are stored in a comma delimited list in table xf_user_option > alert_optout

If wanting to disable one (or more) of these options for all users, then how would I go about doing so? i.e., if wanting to disable all three of these for all users:
post_insert
post_insert_attachment
user_following

then how can I successfully do so without also wiping out users' existing alert optout preferences?

...essentially, I think I need a query that will add these 3 in a comma delimited list to all users (but not if they're already listed on the user). I don't know SQL enough to make a non-disastrous test, but it could possibly be 3 separate queries (1 for each alert type), along the lines of:

IF 'alert_type_x' is not listed in 'alert_optout'
THEN append ',alert_type_x' to 'alert_optout'
ELSE
quit


Any suggestions? Likely the even more complicated piece is that I'll need to somehow be able to disable this by default for new user sign-ups thereafter.
 
Back
Top Bottom