Zapier has released 10 official Discourse zap templates. These templates make it possible to connect Discourse with an external application with minimal configuration. You can find them here:
Scroll down that page to see the list of the currently available integrations.
These templates are divided into two types. In the first type, Discourse is the trigger app. These templates allow you to publish Discourse posts to Slack, Mattermost, Discord, Rocket.Chat, Facebook Groups, Facebook Pages, and Twitter. In the second type of template, Discourse is the action app. With these templates you can publish posts from WordPress, and Ghost to Discourse. There is also a template for publishing Twitch live streams to Discourse.
Adding your Discourse credentials on Zapier
To use any of the Zapier Discourse integrations, you will need to add your forumâs base URL, as well as your Discourse username and API Key when you first setup the Zap.
For most cases, the Zap should be configured by a site admin with their Discourse username and API Key. API Keys can be generated on Discourse in the Permissions section of an Admin / User page. API Keys can be retrieved from that page when they are first created, or from the Admin / API page if you need to retrieve them at a later time.
After adding your Discourse credentials to Zapier, click the Continue button. You should see a Success message on the screen.
Configuring which posts the Zap will retrieve
When Discourse is the trigger app, by default all new posts on your site will trigger the Zap. You can limit the Zap to only be triggered for posts created in a specific topic, or to only be triggered for posts created by a specific user, in the optional âEdit Optionsâ step.
Use the stepâs Topic dropdown menu to select a specific topic that should trigger the Zap. When this is configured, only posts created in the chosen topic will be retrieved by Zapier. Use the stepâs Author dropdown menu to select a username for the Zap. When configured, only posts created by this user will be retrieved by Zapier.
Adding a filter step for finer control over posts
If the âEdit Optionsâ step doesnât give you enough control over which posts are used to trigger the Zap, you can add an optional Filter step to the Zap. An example of what can be done with a Filter is that you could choose to only have the Zap continue if the post is the first post in a specific category. To add a Filter, click the icon thatâs below the Trigger, and then select âFilterâ from the menu.
The filter will allow you to set the conditions under which the Zap should continue. The example below will only continue if the post is the first post in a topic that is in the category with an ID of 2.
Selecting the Discourse content to publish
When publishing posts from Discourse to another application, Zapier will allow you to select which part of the post youâd like to publish. What you choose to publish will depend on the application you are publishing to. Iâll use publishing a Discourse post to a Facebook Group as an example.
The formâs Message field sets the content that will be published. To publish the full post content, select the âRawâ field from the Message dropdown. To just publish the topicâs title, select âTopic Titleâ from the dropdown.
Constructing a link to a post or a topic
When publishing a Discourse post to an external application, you may need to construct a link to the post or its topic from the data that is returned from Discourse. To do this, enter your siteâs base URL into the field youâre adding the link to, followed by /t/
. For example, if your siteâs URL is https://discourse.example.com
, enter https://discourse.example.com/t/
into the form.
Now open the fieldâs dropdown menu and select Topic Slug from the menu.
Zapier will add a placeholder for the topic slug to the field.
Now enter a slash (/
) after the topic slug placeholder and then select Topic ID from the dropdown menu.
The final result will look similar to the screenshot below.
To construct a link to specific posts in a topic, add another slash (/
) to the field and then select Post Number from the menu.
Note that the values of any placeholders you use in setting up the Zap will be replaced by the values passed from Discourse when a new post is published.
Creating integrations without a template
The Zapier templates that are listed on their integrations page are designed to make it easy to connect Discourse with an external application. If you would like to connect Discourse to an application that doesnât have a template, or if you would like to create a Zap that listens for a Discourse webhook, or makes a POST
request to the Discourse API, you can do that by following or modifying one of the guides listed here:
- Trigger a Zapier task with Discourse Webhooks
- Automate sending Discourse invite emails with Zapier
- Make requests to the Discourse API with Zapier
- Create a Salesforce lead via Zapier when a user signs up on Discourse
- Add Automated Metrics Collection with Zapier
Last edited by @JammyDodger 2024-05-28T13:00:32Z
Check document
Perform check on document: