FEATURE: Add user_confirmed_email to user event webhook (PR #12539)

Requested by @coding-horror in Sept 2016 :innocent:

At the moment, a webhook is fired for user_created when a user signs up, but if you want to do anything with it, like keep another system in sync, you’d want to ensure the user is who they say they are first, which email confirmation provides.

Note this is slightly different from activating a user, as this would cover a user changing their email (and then confirming it) as well.

You’ll see in web_hook_spec.rb:327 I removed user.activate. I assume this was in there because the original intention may have been to fire the user_created webhook after a user is activated. In fact it fires immediately when the user is created/signs up, so this line is not necessary. But I removed it because #activate also confirms the user’s email address, which triggers this webhook, therefore the most recent webhook would be user_confirmed_email.

GitHub

This looks good to me, but I haven’t worked too much with webhooks. What do you think @ZogStriP ?