I’m working on a plugin that will add users to a group if their email address matches a whitelist.
I have it working for new users with:
DiscourseEvent.on(:user_created) do |user| GroupDomain.add_to_group_if_in_whitelisted_domain(user) end
What I want to do next is have it move users to the group if they change their address to a matching domain. I would think that
DiscourseEvent.on(:user_updated) do |user| GroupDomain.add_to_group_if_in_whitelisted_domain(user) end
would do the trick, but it doesn’t. (Then I thought that if they changed their email address and then changed anything else in their user record that it would work, and it does!)
Is there some event that I can call/watch (I’m just a caveman) that will fire if their email address is changed?