Discourse Webhooks and Zapier

(Arpit Jalan) #1

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 Zap

Look for this button on Zapier dashboard:

Set up Trigger

Set up Action on 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). :tada:

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.

  1. Click “show less common options”
  2. Click “Catch Raw Hook”
  3. Follow the remaining steps to configure the trigger normally.

Once the trigger is configured, add a filter.

  1. Click “Add a Step”
  2. Click “Filter”
  3. Click “Save and Continue”
  4. Select “Headers Http X Discourse Event” from the first dropdown.
  5. Select “(Text) Exactly matches” from the second dropdown.
  6. Enter the complete header you want to filter for (for example, user_logged_out).
  7. If you want Zapier to run on multiple headers, click “+OR” and add them just like the first.
  8. Click “Test & Continue”
  9. Review the filter test, then click “Continue”

Once the filter is configured, configure your preferred action.

Put in a vote for Discourse in Zapier apps
Zapier or another IFTTT service
How to get email notifications when new users have signed up?
Infusionsoft marketing for new users?
Auto Post New Topics to Social Media
Automatic Facebook (or other social) sharing of topics / posts to a FB page
Send email to new users 24 hours after joining
Can we output a post to a text file?
How to differentiate webhooks for created, approved or updated
How to differentiate webhooks for created, approved or updated
Problems with the new-user webhook
Notification of new users joining
Has anyone tried this RSS poster?
(Aryo) #2

Is this method applicable for posting discourse content to facebook page automatically? Say every new topic that is created, posted to facebook page automatically.



Yes. You’ll need to connect Facebook and Zapier first.

Plugin for auto posting to social media?
(Mittineague) #4

Does the existing “share to Facebook” feature not work for you?


They want it to be automated.

(Aryo) #6

I just tried it using RSS via Zapier + Facebook. It seems working! Every new topic posted in discourse is automatically posted to my facebook page. Nice nice!

(James) #7

Can I use this to add the email address of the new user to a list?


Not possible as of yet but has been requested to be added

(Jesse Plautz) #9

Can you elaborate on that? I’d like to implement this for my FB page. Is it just the discourse RSS feed > Zapier > Facebook?


It would be a new post webhook from your admin api page into zapier and then to Facebook

See the first post for an example

(Jesse Plautz) #11

Actually I just figured out how to do it using the RSS feed from discourse. Worked perfectly.

(Jesse Plautz) #12

Hey if you’d like to see a working example of this, I feel like I have a pretty slick setup and I’m really happy with it.

I have zapier setup to take all new discourse posts, parse the title and content, then post it on my Facebook page with a custom picture I designed.

My forum is here: community.vapementors.com
My FB page is here: /vapementors
Here is an example post taken from my Zapier integration: VapeMentors - @JesseVapeMentors wrote: Scott Gottlieb... | Facebook

(Christoph) #13

I understand that the user event webhook is triggered whenever a user is created, approved or updated. Does the payload include any indication which of the three events triggered hook?

I would like to trigger my zap only in the case of a new user being created, not in the other cases…

Is there any way of achieving this?

UPDATE: I now understand that the user event is provided in the webhook header:

X-Discourse-Event-Type: user
X-Discourse-Event: user_created

But Zapier does not seem to give me access to header information (only payload). Is there any way to filter by event nonetheless? @fantasticfears or @techAPJ, could you point me in the right direction?

I can't get the welcome message to display
Setting up webhooks
(Erick Guan) #14

I think Zapier offers customized code somehow. If so, you can use that!

(Christoph) #15

What do you mean by “customized code”?

(Erick Guan) #16

Can you write code in Zapier? You might want to ask them about it!

(Christoph) #17

Yes, you can (JavaScript and Python): Code by Zapier Integrations | Zapier

But I can’t…

(Erick Guan) #18

Pretty sure it can be done in $20. If you can wait for a few days, I am for the job

(Christoph) #19

Okay, that would be great!

(Erick Guan) #20

The result of this work is public here. Install this plugin and you will find user_created event in the webhook panel.

Email Newsletter For Forum Members
Setting up webhooks
Webhook for new users
How to collect user emails when they sign up
Send email to new users 24 hours after joining