XF 2.0 Email Notifications for some users but not others

Mr Lucky

Well-known member
I am testing an upgrade to xf2 with a few select users. The problem is that I want those people to get email notifications but not the the thousands of other users who are not part of the testing, because then those users will get notifications (for their watched threads) that link to the test forum for which they don't have access.

Maybe bulk ban all the non testing users ??? I think that would work, but is there another way?
 
That might be ok though it prevents more people joining in without intervention and prevents things like viewing people’s profiles etc. However technically users without an email address is valid within XF. You can’t set your own account to have no email address in your account settings, but an admin can remove an email address / create a user without an email address.

To do that in bulk, collate a comma separated list of user IDs which ARE allowed email and run the following command:

SQL:
UPDATE xf_user
SET email = ''
WHERE user_id NOT IN(1, 2, 3, 4)
(Replacing 1, 2, 3, 4 with your user IDs)

That should do it (though do some cursory testing).
 
Thanks Chris, would this be OK with a user group? (Seemed to be OK when tested, just wondering if there might be any issues)

SQL:
UPDATE xf_user
SET email = ''
WHERE user_group_id NOT IN( 4)
 
Yeah that would only work if you have any users with their primary user group as 4, which I presume is not the case (the primary group is likely 2 - registered and 4 is in their secondary groups). Had you held on for a bit longer I'd have given you the correct query ;)

As it stands, now that is done, you might as well just get them to re-add their email address in their account settings :)
 
Yeah that would only work if you have any users with their primary user group as 4, which I presume is not the case (the primary group is likely 2 - registered and 4 is in their secondary groups). Had you held on for a bit longer I'd have given you the correct query ;)

As it stands, now that is done, you might as well just get them to re-add their email address in their account settings :)

Of course, I didn't think of that!

No problem though because I just re-imported the backup (I always back up databases when testing)

So I would still appreciate the correct query for secondary uaergroups, many thanks.
 
Back
Top Bottom