Sending Bulk User Invites

(Arpit Jalan) #1

:warning: if you have SSO enabled, or have disabled local logins, invites cannot be sent as they would bypass parent site authentication. Invites only work if SSO is not enabled and local logins are enabled.

So you want to invite users to your Discourse instance, but you have so many that sending invites individually would be a huge pain? Good news – you can send bulk invites! Here’s how:

Prepare CSV File

Prepare a CSV file with the users you want to invite. These points should be considered while preparing CSV file:

  • One user per line.
  • Email is required in the first column, and the email must be valid.
  • Any permissions groups you want this user to be a member of should be in second column. For multiple groups, separate group names with a semicolon group_1;group_2;group_3
  • Normally invited users arrive at the homepage. If you would rather invited users end up on a specific topic, enter that Topic ID in the third column.

The format is:,group_1;group_2,topic_id

Note that group names and topic id are completely optional, only email is mandatory. You can have an invite that is just the email alone:

It’s easy to create CSV files in a spreadsheet, which would look like this:

Just be sure to save the file as CSV when you’re done.

Upload CSV File

Go to Invites page and upload the CSV file by clicking Bulk Invite from File button.

You will see a confirmation modal show up asking for approval to send messages to these users. Click Go Ahead to proceed inviting.

Afterward, you’ll receive a confirmation stating you’ll be notified when the process is complete.

Check Bulk Invite Progress Notification

Once the CSV file is processed, you will receive a private message notification with progress report.

The notification will summarize what happened with your bulk invites, including total counts of invites sent and not sent. Check your invites page on your user profile to see a list of the invites that were successfuly sent.

If there were errors reported, you can submit a new bulk invite file with the corrected lines.

Invites Sent

Each email address will receive an invite email:

username invited you to join

Community Title

A brief description of this community taken from the site description setting.

If you’re interested, click the link below:

Once clicking the confirmation link:

  • their account will be immediately activated and associated with this email address
  • they will be added to the specified groups (if specified)
  • they will be directed to the topic ID (if specified)

If the invites are never clicked, they will expire naturally after 30 days.

Congratulations! That’s it, you’ve successfully sent out bulk invites.

Bulk Invite Users
Invite friends by importing email address book
Any mass email functionality?
How can I bulk organize users into groups?
Replacing Mailing lists: Email-In
Creating Active Users via the API gem
How to kick start a community?
Is it possible to assign a group with batch invite?
Use case: 1000 people having a discussion right after an online conference
Bulk registration without email confirmation
Bulk invite: explain format on screen
Inviting users to auth required site?
How can i import csv mail my discourse?
Generating lots of Invite Tokens
Multiple invites on single topic?
Bulk invite: explain format on screen
Bulk add to Group limitations
Which template corresponds to bulk invitation with specified topic id?
Bulk add to Group
Import users from csv
Automate invitation system
(Erlend Sogge Heggen) #2

Fantastic feature. But how big of a bulk are we talking about here? Would 10k users be no problem, provided e-mail is set up right?

(Arpit Jalan) #3

I haven’t tested it for that much users, but since the CSV file is processed in background thread, I believe that wouldn’t be a problem.

(Jeff Atwood) #4

10k emails sent to potential invited users might cause problems with your email provider, though.

(arajvanshi) #7

I sent 300 invites and it is showing only top 30 in the “invites sent”. Rest 270 are completely invisible to me. I think you need to add pagination in the “invites sent” section.

1 Like
(Arpit Jalan) #9

PR sent for this feature:

(Joshua Frank) #16

Is it possible to specify the user name as well. If the user’s address is, it defaults the user name to contact, and that’s a bad username. I can nag them to change it, but that’s an extra step and people aren’t doing it so far.

(Arpit Jalan) #17

This might be what you need:

(Allen - Watchman Monitoring) #18

Would it be feasible to set a custom field value with this import process?

1 Like
Bulk Invite - Custom Message. Is it possible?
(Tobias Eigen) #19

I just had an odd problem - I invited 33 people to a group and topic, and for some reason the people were invited to the wrong topic! This has messed me up unfortunately. What am I doing wrong? How can this happen? :frowning:

Am I right that the topic ID for this topic is 16468, gleaned from the URL:

Sending Bulk User Invites

My invite CSV contained lines like this:,Bloggers,2270,Bloggers,2270,Bloggers,2270

On my forum 2270 is a topic in the private Bloggers group that is specifically written to invite these people. Instead they were linked to a totally different topic!

(Jeff Atwood) #20

Topic id is the first number in the URL. Any repro @techapj?

(Tobias Eigen) #21

Thanks for looking into this - I feel like I’m in limbo as I don’t want to do any more inviting until I know what will happen. :slight_smile: Though I just did a test and will be able to send out individual invites directly to the topic, one at a time.

Three thoughts occurred to me since I posted this yesterday:

  1. is it possible that this failed because I was inviting people to a private group and a topic in a private category that only users in that private group can access? are there any limitations or considerations for the topic being invited to?
  2. I think I have seen this discussed elsewhere, but it would have been very helpful to have an intermediate step between uploading the CSV and actually performing the invite action. E.g. a quick preview of the first three emails that will be contacted and what the email will look like that will be sent out. There’d be links to go go forward to perform the invite or to go back to upload a new CSV.
  3. One way around all of this for my use case would have been to enable CSV uploads when inviting people directly to a topic, or simply to allow a list of comma-delimited email addresses instead of just allowing one. The max number allowed could be specified on the settings page. In my case a sane number would be 10.



(Arpit Jalan) #22

Weird, I just tested the same case, and it’s working fine for me. Can you please try this again on another private topic perhaps?

(Tobias Eigen) #23

I just tried it again using the exact same CSV file that I used on Friday, just changing the email address to a new test email… and it is now working correctly and as expected. I just checked in mandrill and yes, the original invites sent on Friday with this CSV invited the person to a different topic.

Chalk this one up to the mysteries of the interwebs?

1 Like
> Uncaught TypeError: Cannot read property 'assignBrowse' of null
> Url:
> Line: 26
> Column: 69
> Window Location:

Unable to upload file.

REQUEST_URI: /logs/report_js_error
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36

  message: Uncaught TypeError: Cannot read property 'assignBrowse' of null
  line: 26
  column: 69
  stacktrace: TypeError: Cannot read property 'assignBrowse' of null
(Arpit Jalan) #26

@eviltrout fixed this issue:

Update your Discourse instance, this should be fixed now.

1 Like
(Noneck) #29

I’m trying this and I keep getting the following error.

[2015-02-04 19:09:30 +0000] Invalid Email ‘Email’ at line number ‘1’
[2015-02-04 19:09:30 +0000] Invalid Group ‘open-data’ at line number ‘2’
[2015-02-04 19:09:30 +0000] Invalid Group ‘general-discussion’ at line number ‘2’

This is the CSV I am sending.


Note, this is a nested category and sits under a “working group” parent.

Group -
Topic -

What am I doing wrong? I’ve tried every group name permutation.


(Jeff Atwood) #30

Send your file to @techapj via PM and he will have a look.

(Kane York) #31

I think this means you need to remove the CSV header line.

That column is supposed to be security groups, not categories.

i.e. this page should exist:

(Compare to, which does exist. Note that the ‘admin’ group is special - it’s calculated, and it’s special-cased in the inviter to grant admin.)