Problems with the new-user webhook

AI-generated summary

watchmanmonitor reported a bug where the Discourse new-user webhook failed to trigger upon user registration, despite the ‘User Event’ setting being enabled. While the webhook successfully fired for user edits and welcome messages, self-registered users and those suspended/reactivated did not generate a ping. watchmanmonitor clarified that the issue persisted even with standard username/password signups, ruling out SSO as the primary cause, though codinghorror initially suggested checking SSO configurations. tgxworld acknowledged the report as a bug and provided a fix in commit bf78c22. After upgrading to the latest version, watchmanmonitor confirmed the webhook now fires correctly for new registrations, even before email confirmation. Additionally, mikechristopher verified the fix worked in their environment and requested including email addresses in the payload, a feature request watchmanmonitor later moved to a separate thread. watchmanmonitor noted the solution allows for proactive tracking of users who register but do not complete confirmation.

Continuing the discussion from Discourse Webhooks and Zapier:

I want to get notified for every new user which is created in our forum.

The setup is below, and my forum is configured as follows:

  • The public can view a few categories
  • Group membership is required to read most of the rest.
  • the public can sign up, and validate themselves as a new user without any human interaction.
  • There is an SSO signup button which uses our main SaaS app for SAML authentication, and it will automagically apply the Group membership we wanted.

When I setup the webhook with just “User Event”, no ping was sent.

When “Post Event” was checked, I did get a webhook with data about the new user (recipient) and the sender of the welcome email.

How else can I troubleshoot new user creation’s webhook sending?

1 curtida

Any ideas here for troubleshooting @tgxworld?

Can I clarify if you tested the “ping” action or do you mean that user events are never sent?

I have had an issue before where as new user events are not sent but edited user events are. As per here

Have not revisited it since

1 curtida

Correct.. I should have said “no webhook was sent”

I can use the ping feature, and zapier sees the ping just fine. I did see an event sent for the welcome message.

I didn’t see a new user webhook on either of the new users I tried.

I guess there’s a bug here:

  • A user self registering did not send a webhook.

  • There was no Approval needed in this forum. I think it should be tested to fire with & without an approval step.

  • Suspending & re-activating the user did not send a webhook.

  • Editing the user’s title did generate a webhook, and Zapier handled it well. :fireworks:

4 curtidas

Are you sure this isn’t because of your SSO?

1 curtida

The user I tested with signed up with a username & password. I don’t think think so.

We’re using a SAML Login button from

https://github.com/discourse/discourse-saml/

we don’t use traditional SSO

2 curtidas

I feel like this is a bug @tgxworld – why would the new user webhook not fire?

Thanks for reporting @watchmanmonitor :slight_smile: Fixed in

https://github.com/discourse/discourse/commit/bf78c228f439097aaea05ddc29e3f3dfeaa2cd3f

Do upgrade to latest and let me know if this fixes it for you :slight_smile:

7 curtidas

updated my test environment and built some new webhooks into zapier and seems to work well thank you for that!

As i believe it was something that fantasticfears was working on as part of the original webhooks pull request that was open - is it possible to get the email address included as part of the payload.

Thanks,
Mike.

4 curtidas

Confirmed, I updated to latest this morning, and about 20 minutes later, had a new user register. The webhook fired & my zap worked great.

EDIT moved the feature request to a new thread

4 curtidas

I just tested with the SAML plugin, and with a normal user/pass account.

The best part here is that the webhook is sent at user registration, even before they confirm their address (or forget to..)

Now I can proactively track down people who try to get in, but never finish.

Thanks!

6 curtidas