Automate sending Discourse invite emails with Zapier

The Discourse API can be used to automate sending invitation emails from your forum when an action is performed on an external application. For many applications, you can use Zapier to set this up without having to write any code.

A common use case for this is to invite users to your forum when they purchase a product
or signup on an external service. For the example in this topic I will use the Zapier WordPress integration to trigger sending an invite from Discourse when a new user signs up on a WordPress site.

Setup a trigger step on Zapier

Go to your Zapier dashboard and search for the application that you would like to trigger the invite email. In the screenshots below, I have selected WordPress as the trigger.

The only configuration that is required for this is to connect the WordPress Zap to a WordPress account, and to select the New User event to trigger the Zap.

Setup a action step to send the invite

Click the Add a Step button and then click Action/Search from the dropdown menu.

Enter ‘webhook’ into the search menu and then select Webhooks by Zapier from the actions menu. The Webhook action step will be added to your Zap’s sidebar, and a form will open that lets you choose what type of request you would like the webhook to perform.

Select POST from the form and then click Continue.

The form that opens lets you configure the POST request that is made to Discourse. In the URL field, enter your forum’s base URL, followed by /invites. For example, my forum’s base URL is https://demo.scossar.com, so the full link to the invites route is https://demo.scossar.com/invites

You now need to configure the form’s Payload Type, Data, and Headers sections. All other sections of the form can be left with their default values.

The Payload Type tells Zapier what format to send the payload in. It should be set to Json.

The Data section is used to tell Discourse which email address to send the invite to, and to set an optional list of group names and a custom message. To invite a user without adding them to groups or including a custom message, enter the text email as a data Key, and then click the ‘Insert a Field’ icon to open the field’s dropdown menu. Scroll down the list until you see the value that has been passed from your trigger app that contains the user’s email. When using WordPress as the trigger app, the completed Data section should look similar to this:

To automatically add users to groups when they accept the invite, click the Data section’s :heavy_plus_sign: icon to add a new field. Set the Key of the field to group_names. Set the Value of the field to a comma separated list of group names that you would like users to be added to. To include a custom message in the invite email, create another field with its Key set to custom_message and its value set to the message you would like to send.

Note: by adding a Code step after your Zap’s trigger step it should be possible to dynamically set group names and a custom message for specific users.

The Headers section is used to authenticate your request. To configure the Headers field, you will need to generate an API key on your Discourse site. To do that, go to your Discourse site’s Admin / API page and click the “New API Key” button. When creating the key, assign it to a staff user and set the scope to Global, or use a Granular scope with the Invites > Create box checked.

Now, in the Headers section of the Zap, enter the following key/value pairs. Replace any values that I’ve included in brackets with values appropriate for your site. Capitalization of the key names is important.

Api-Username: <the staff username you want to send the invites>
Api-Key: <the API Key you generated>
Content-Type: application/json

The form should now look similar to the screenshot below, but with your Api-Username and Api-Key:

Click the Continue button.

You will now be able to test the integration by clicking the ‘Send Test To Webhooks by Zapier’ button. The test will be performed with data that you setup in your trigger step. You’ll see a success message if everything is correctly configured, and the user you setup in your trigger step does not yet exist on your Discourse forum, an invite email will be sent and you will see a Success message on Zapier. Once the test step is passing, click the Finish button and turn your Zap on.

For details about how to make other types of requests to the Discourse API with Zapier, see Make requests to the Discourse API with Zapier.

Last edited by @NateDhaliwal 2026-07-06T23:20:28Z

Check documentPerform check on document:
25개의 좋아요

This is awesome thank you for the feature and clear instructions!

Is it possible to also set the custom group when generating an invite, like you can from within the app?

That can be done by adding a group_names key to the Headers field. Its value should be set to a comma separated list of group names. I’ll add an example of this to the topic.

The basic approach that’s used in this topic will work for any API request to Discourse.

3개의 좋아요

Awesome!! I think the dialog accepts a custom message too, guessing that can be done the same way?

1개의 좋아요

I tried setting this up this AM and was running into a 400 error. With a little bit of debugging, I found that the auth-related steps need to go in the headers section as instructed, but the actual form values (email, group name, and custom message) need to go in the data section as key/value sets.

Once I made that change, though, it worked perfectly!

1개의 좋아요

Thanks for that, @simon!

Are there any descriptions on meta about alternative ways to create an automated process for sending an invite email after the reader signed up to an offering and to which you could link here?

Thanks for testing that! What I’m finding is that when no custom_message or group_names are included in the request, passing the email in the Headers works. It’s not the correct way to pass the email address though. I’ve updated the guide to use the Data section for setting the email address, and have included examples for adding users to groups and including a custom message.

4개의 좋아요

I’m not aware of other services that are similar to Zapier, but I’m sure there are some out there. You can make requests directly to the Discourse API without using a third party service. The main requirement for doing this is that you have an application to make the requests from. This can be something a simple as a WordPress site.

A good resource on Meta for getting started with the API is Reverse engineer the Discourse API. You can test API requests with CURL from your computer’s terminal, or with a service like Postman.

2개의 좋아요

Thank you! Most of what you write I have no idea about… but I’ll check I’ll out your links and see if so can understand anything :smiley:

2개의 좋아요

@simon

Quick question:

When I send an automated invite through Zapier, would this then be an already personalized link, or a link to the general login page to my forum (where someone can log in and also create an account)?

I would like to avoid that everybody and their dog who knows the login page creates an account. How can that best be avoided?

When you send an invite link through Zapier you are triggering exactly the same action as if you had clicked the ‘Send an Invite’ link from your account’s Invite page.

Creating an invite will send an email to invited user’s email address. That email contains a link to a page where the invited user can set their name and password, and login to their new account. The email address for the new account is set by the email address that you used for the invite.

Only users who have been sent an invite can create an account through this page. If you would like to only allow invited users to register for your site, go to the Login section of your Site Settings and select the invite only site setting.

The best way to get a sense of how invites work is to invite yourself to your site. You can use a throw-away gmail address for this. You will need to log out of the site before you will be able to accept your invite.

3개의 좋아요

Ah, awesome info. Thanks!!

1개의 좋아요

훌륭한 튜토리얼 감사합니다! 대량 초대 기능처럼 가입 후 사용자가 리다이렉트되는 토픽 ID를 추가하는 방법이 있을까요?

위에서 설명한 것과 유사한 방식으로 새 사용자를 주제에 초대하는 것이 가능합니다. 다만, Action 단계에서 설정하는 URL은 해당 주제를 가리켜야 합니다. 예를 들어, ID가 123인 주제에 사용자를 초대하려면 Action 단계에 https://forum.example.com/t/123/invite라는 URL을 추가해야 합니다. 그런 다음 가이드에 설명된 것과 동일한 방식으로 email 및 선택 사항인 custom_message와 group_names 매개변수를 추가하면 됩니다.

3개의 좋아요

Simon님,

게시해 주셔서 감사합니다!

두 가지 질문이 있습니다. 도와주시면 정말 감사하겠습니다 :slight_smile:

질문 1/
제 환경에서는 초대 + 메시지 기능이 정상적으로 작동하지만, 어떤 group_names를 추가해도 포럼에 가입하면 기본 공개 그룹에만 접근할 수 있습니다.

특정 비공개 그룹 초대를 "차단"하는 요인이 있는지 아시나요?

그룹 이름의 URL은 다음과 같은 형식입니다: https://forum.[mywebsite].com/c/cercle/33

따라서 저는 다음을 사용하고 있습니다: group_names /// PUBLIC,cercle

그룹 이름 대신 해당 그룹의 “번호”(33)를 사용해보기도 했지만, 여전히 작동하지 않습니다.

포럼 관리자 설정에 비공개 그룹 초대를 차단하는 일종의 "제한"이 있는 것은 아닌지 궁금합니다.

질문 2/

"비공개 그룹"뿐만 아니라 "비공개 “서브그룹”(정확한 명칭을 잘 모르겠습니다)에도 사람들을 초대할 수 있도록 하고 싶습니다.

여기서 "RÉSERVÉ…"라는 그룹과 그 아래에 있는 모든 작은 서브그룹을 볼 수 있습니다.

특정 서브그룹으로 사용자를 초대하고 싶습니다.

이 방법을 아시는 분 계신가요?

이 문제에 대해 시간을 내어 도와주시면 정말 감사하겠습니다! :slight_smile:

1개의 좋아요

그룹이 접근할 수 있도록 허용한 카테고리의 이름이 아니라 그룹 자체의 이름을 사용하고 있는지 확인하세요. 그룹 이름은 그룹 URL에서 또는 그룹의 이름(Name) 필드에서 찾을 수 있습니다:

이로써 문제가 해결되지 않는 경우, Zapier에 추가하는 Discourse API 키가 전역(All Users) API 키인지 확인하세요. 또한, Zapier에 설정된 API 사용자는 그룹에 사용자를 추가할 수 있는 권한이 있는지 확인하세요. 사이트의 관리자 계정 이름은 이 용도로 사용할 수 있습니다.

이 방법으로 문제가 해결되지 않으면 알려주세요.

Zapier의 group_names 필드에 쉼표로 구분된 그룹 이름 목록을 추가하여 사용자를 여러 그룹에 초대할 수 있습니다. Discourse에는 서브그룹이라는 개념이 없으므로, 사용자를 초대하려는 각 그룹의 이름을 추가해야 합니다.

제공해 주신 스크린샷을 보면, 사용자에게 카테고리 및 해당 모든 하위 카테고리에 대한 접근 권한을 부여하려는 것으로 보입니다. 각 하위 카테고리에 대해 그룹을 생성하는 대신, 단일 그룹에게 카테고리 및 모든 하위 카테고리에 대한 접근 권한을 부여하는 것이 더 좋습니다. 이는 카테고리의 편집 페이지 보안(Security) 섹션에서 설정할 수 있습니다.

2개의 좋아요

답장 주셔서 감사합니다, Simon!

API 관련해서 말씀드리겠습니다.

처음에는 관리자 한 명에게만 접근 권한을 부여했는데, 이게 괜찮을 것 같았습니다. 그래서 이제 모든 사용자에게 접근 권한을 부여하기 위해 새로운 API를 생성했습니다.

하지만 여전히 작동하지 않았습니다. 다만 문제가 무엇인지 파악한 것 같습니다 :slight_smile:

“group_names” 필드에 “category” 이름을 입력하고 있었습니다. 그래서 작동하지 않는다고 추측합니다 :).

그룹/카테고리/토픽의 명칭을 오해했습니다.

스크린샷에서 약 15개의 하위 카테고리 목록(TB, MT, RD, MA 등)을 볼 수 있습니다.

예를 들어, 첫 번째 하위 카테고리의 URL은 다음과 같습니다: https://forum.MYWEBSITE.com/c/question-formactions/TBD/14

따라서 특정 그룹이 아니라 일부 비공개 하위 카테고리에 새로운 멤버를 자동으로 초대하고 싶다는 뜻입니다.

제가 제공한 URL에서, 예를 들어 “TBD” 하위 카테고리에만 접근 권한을 부여하고 싶습니다.

그리고 다른 사용자는 또 다른 하위 카테고리에만 접근 권한을 갖게 됩니다.

이것이 가능한지 아시는 분 계신가요?

아마 Zapier에서 “group_names” 필드를 카테고리 관련 필드로만 교체하면 될 것 같습니다.

1개의 좋아요

Discourse에서 그룹과 카테고리는 많은 혼란의 원인입니다!

  1. 그룹은 사람들의 집합입니다.
  2. 카테고리는 주제들의 집합입니다. 기본적으로 사람들에게 카테고리를 초대할 수는 없습니다. 그러나 이러한 카테고리의 접근 권한은 그룹에 의해 제어됩니다.

원하는 결과를 얻으려면 그룹을 생성하세요. 해당 카테고리의 보안 설정에서 그 그룹에 대한 접근 권한을 추가하십시오. 그리고 초대 API에 해당 그룹을 사용하세요. 끝.

3개의 좋아요

답장해 주셔서 감사합니다, 네이선!

그렇게 해 보고 결과를 여기에 올릴게요 :wink:

2개의 좋아요

해결 방법이 잘 작동합니다. 감사합니다! :smiley:

또 다른 질문이 있는데, 혹시 당신(또는 @simon)이 이 부분에 대해 도움을 줄 수 있을까요?

Zapier를 사용하여 이미 Discourse 멤버인 사용자에게 새 그룹에 대한 접근 권한을 부여하는 방법이 있을까요?

기본적으로 제 워크플로우는 다음과 같습니다:

1/ 멤버가 제 강의 중 하나에 가입합니다.

2/ Zapier가 제 학습 플랫폼에서 해당 사용자의 이메일을 가져와서 제 Discourse에 초대장을 보내고, 방금 가입한 강의와 관련된 올바른 그룹에 자동으로 추가합니다.

3/ 몇 달 후, 같은 멤버가 또 다른 강의에 가입할 수 있습니다. 현재 프로세스에 따르면, Zapier가 이미 Discourse 멤버인 사용자에게 또 다른 초대장을 보내게 되는데, 이 경우 초대장은 작동하지 않습니다.

Discourse 멤버인 경우, Zapier가 새 그룹에 대한 접근 권한을 부여해 주었으면 합니다.

이렇게 할 수 있는 방법이 있을까요?

1개의 좋아요