# このワークフローの設定方法：有料メンバーシップフォームからDiscourse招待へ

**URL:** https://meta.discourse.org/t/how-do-i-set-up-this-workflow-membership-form-with-payment-discourse-invite/93669
**Category:** Support
**Created:** [2018 年 8 月 1 日午後 6:03 UTC](https://meta.discourse.org/t/how-do-i-set-up-this-workflow-membership-form-with-payment-discourse-invite/93669 "2018-08-01T18:03:16Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2018 年 8 月 2 日午後 6:43 UTC](https://meta.discourse.org/t/how-do-i-set-up-this-workflow-membership-form-with-payment-discourse-invite/93669/4 "2018-08-02T18:43:00Z")

</div>

You can send an invite through the Discourse API by making a POST request to `https://forum.example.com/invites`

In the body of the request you need to include the All Users `api_key` and `api_username`. The All Users `api_username` defaults to ‘system’. The other parameter that you need to include is `email`. You can optionally include a `custom_message` and a `group_names` parameter. The `group_names` parameter should be set to a comma separated list (without spaces) of group names for groups that already exist on your forum.

Here is an example API call made with curl. `$api_key` is set to the All Users API key for my forum. The URL is the URL of my local development forum:

```plaintext
curl -X POST -d "api_key=$api_key&api_username=system&email=johndoe@example.com&custom_message=Thanks for your contribution." http://localhost:3000/invites

```

The response you should get for a successful invite is `{"success":"OK"}`.

Once you have this working with curl or [Postman](https://www.getpostman.com/), it should be possible to wire up your application to make the request automatically when a user makes a contribution.

You can customize the email templates that are used for sending these invites. The template that is used if a custom message is included is the **Custom Invite Forum Mailer** template. The template that is used when a custom message is _not_ included is the **Invite Forum Mailer**.

For details about finding which API request to make to perform a specific action, see the [Reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576) topic. For details about customizing email templates, see the [Customizing specific system email templates](https://meta.discourse.org/t/how-to-customize-email-templates/88323) topic.

---

_[View the full topic](https://meta.discourse.org/t/how-do-i-set-up-this-workflow-membership-form-with-payment-discourse-invite/93669)._
