Want to use Discourse Webhooks to trigger a task via Zapier? Let’s get started!
Zapier requires a trigger and an action. In this howto the trigger will be a Discourse Webhook and the action will be to send an email.
Send an Email on any User event
We will now set up a Zap to send email on any user event (i.e when a user is created, approved or updated). To trigger on a specific user event, see Trigger on a specific user event below.
Create a Discourse Webhook
Create a new Discourse Webhook for user event
We will update the “Payload URL” once the webhook URL is generated in next steps.
Create a new Zap
Look for this button on Zapier dashboard:
Set up Trigger
Select Webhook as Trigger. Look for:
You want to select “Catch Hook”
You can skip “Set up Webhooks by Zapier Hook” step.
Just press “Continue”.
Copy the custom webhook URL generated and paste it in “Payload URL” section of Discourse Webhook originally created.
Now try creating/updating/approving a user on your Discourse instance.
If you successfully followed all the steps and created/updated/approved a user, you will see a success message on Zapier:
Clicking on “view your hook” hyperlink will show the parsed data.
Set up Action on Zapier
Select Email as Action. Look for:
Press “Save + Continue”
Set Up Email Template
Further modify the email template as per your requirement. Note that you can use the
+button to add more data parsed via JSON response.
Now test the action, you should receive an email from Zapier.
Turn on the Zap
That’s it, now you will receive an email for every new user event (i.e when a user is created, approved or updated).
Trigger on a specific user event
Want to only send emails for a specific user event, perhaps only on account creation, but not on update? Use the “Catch Raw Hook” trigger.
- Click “show less common options”
- Click “Catch Raw Hook”
- Follow the remaining steps to configure the trigger normally.
Once the trigger is configured, add a filter.
- Click “Add a Step”
- Click “Filter”
- Click “Save and Continue”
- Select “Headers Http X Discourse Event” from the first dropdown.
- Select “(Text) Exactly matches” from the second dropdown.
- Enter the complete header you want to filter for (for example,
- If you want Zapier to run on multiple headers, click “+OR” and add them just like the first.
- Click “Test & Continue”
- Review the filter test, then click “Continue”
Once the filter is configured, configure your preferred action.