# Invite token bulk email API sample

**URL:** <https://meta.discourse.org/t/invite-token-bulk-email-api-sample/17186>\
**Category:** Feature\
**Tags:** rfc, spec\
**Created:** [7월 3, 2014, 11:57오후 UTC](https://meta.discourse.org/t/invite-token-bulk-email-api-sample/17186 "2014-07-03T23:57:45Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [7월 3, 2014, 11:57오후 UTC](https://meta.discourse.org/t/invite-token-bulk-email-api-sample/17186/1 "2014-07-03T23:57:45Z")

</div>

@codinghorror started a sister topic on general [improvements to the invite system](https://meta.discourse.org/t/improve-topic-invites/17184).

In some cases these changes just will not cut it.

- In some cases people may want to send out a batch of invites via a third party tool, mailchimp, boomerang and so on. Many of these platforms are designed for ~~email spam~~ and provide better feedback and statistics.

- In some cases people may want complete control over, **subject** and **body** of the email. They may want to include custom copy that differs to the standard email.

To achieve this we need to amend our API endopoint to allow for generation of tokens.

The spec is quite simple:

1. Input is the exact same format our CSV invite takes
2. Output is a CSV containing emails and invite links

###Example

```bash
gem install discourse_api
discourse_api --key API_KEY --username USER generate_invite_tokens INPUT.CSV > OUPTUT.CSV

```

Side project here is making the api gem more usable, having it distribute a binary to run all sorts of tasks like this.

Note:

@techAPJ will be working on this after he is done with general invite improvements.

Feedback @stevebaer @bobmcneel ?

---

_[View the full topic](https://meta.discourse.org/t/invite-token-bulk-email-api-sample/17186)._
