How to get an email notification when a user joins?

Hi there,

I wonder if I can configure a webhook for example that emails me every time someone creates a new member on my forum?

As I understand it a weebhook payload URL has to be created through for example Zapier or is it possible without having to register there?

Best regards
Olle

1 Like

You can do it without zapier but you do need to have a script of some kind that is triggered using the webhook and takes the payload and emails it to you. You can’t just program webhooks to send you an email.

For the example you give, you could also enable must approve users but then that would restrict login until you approve the new user manually.

For more about webhooks, take a look at: Discourse API Docs

2 Likes

Would it be possible without the must approve users setting?

It would be nice since my forum is quite new and I dont have many users,

Best regards
Olle

1 Like

Are you looking for a little nudge for when someone first joins?

If you’re not tied to webhooks you could create a data explorer query and use a recurring Automation to send you a PM whenever there are new results.

I suggested a similar thing for a slightly different use case here:

3 Likes

Automation is a good idea! I just tested this and you can actually use an existing automation, if you’re willing to create a user custom field and require your users to complete it at signup.

Steps that worked for me:

  1. create a custom user field and make it required
  2. create a topic in your Staff category
  3. create a new automation
  4. choose “Create a post” script
  5. choose “After user update” trigger
  6. choose your custom field
  7. select “once per user”
  8. select “new users only”
  9. specify system as the creator
  10. specify the topic ID of your topic (the number that appears in the URL)
  11. write the content you like, including the variable e.g. “{{updated_user_username}} signed up!”
  12. sign up a new test user to test
4 Likes

That is pretty cool! What did you insert for the custom user field that is required?

I just used an existing required field I had already set up previously. I ask all members of my personal site to provide their phone number.

1 Like

Though for some potentially universal ones you could have something like:

  • I accept the terms and conditions

  • I am not a robot

But a change to the trigger so you could have ‘user created/activated’ for this and not need a superfluous custom field would be :chefs_kiss:


Just a couple of extra notes now I’ve given it an actual run-through :slight_smile:

Probably obvious, but for topic_id you can also use a PM topic id (with the added benefit of a shorter email window delay, in case time was of the essence)

One potential downside is that the post is created when a user signs up rather than after they activate their account/verify their email. Though this may not be an important nuance.

You also want to make sure the post creator is the system user (or similar alternative) as you won’t get notified of your own posts if you use yours as the sender.

But just to confirm, a confirmation box custom field works just fine. :white_check_mark:

3 Likes

Created feature request: Allow "after user update" automation trigger to fire without custom field

2 Likes