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:

name@example.com,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:

name@example.com

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 should see a confirmation message once the file is uploaded.

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:

http://discourse.example.com/invites/d377050add482483d24723f14eac4c45

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
Bulk invite users?
Is it possible to assign a group with batch invite?
Creating Active Users via the API gem
Bulk invite: explain format on screen
Invite sent emails discrepancy Discourse vs Mandrill
Multiple invites on single thread?
Use case: 1000 people having a discussion right after an online conference
Is it possible to link to specific revision of a post?
Bulk add to Group
Bulk registration without email confirmation
Which template corresponds to bulk invitation with specified topic id?
Import users from csv
Bulk add to Group limitations
Bulk invite: explain format on screen
Inviting users to auth required site?
How can i import csv mail my discourse?
How to kick start a community?
(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.


(Arpit Jalan) #9

PR sent for this feature:

https://github.com/discourse/discourse/pull/2617


(Joshua Frank) #16

Is it possible to specify the user name as well. If the user’s address is contact@thepersonsname.com, 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?


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:

email@foo.com,Bloggers,2270
email2@foo.com,Bloggers,2270
email3@foo.com,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.

Cheers,

Tobias


(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?


#24
> Uncaught TypeError: Cannot read property 'assignBrowse' of null
> Url: http://www.onenew.net/assets/admin-33f85b057136638bb2e5362a4aabab69.js
> Line: 26
> Column: 69
> Window Location: http://www.onenew.net/users/one/invited

Unable to upload file.


#25
HTTP_HOST: www.onenew.net
REQUEST_URI: /logs/report_js_error
REQUEST_METHOD: POST
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
HTTP_ACCEPT: */*
HTTP_REFERER: http://www.onenew.net/users/one/invited
HTTP_X_FORWARDED_FOR: 222.129.109.225
HTTP_X_REAL_IP: 222.129.109.225

params:
  message: Uncaught TypeError: Cannot read property 'assignBrowse' of null
Url: http://www.onenew.net/assets/adm
  url: http://www.onenew.net/assets/admin-33f85b057136638bb2e5362a4aabab69.js
  line: 26
  column: 69
  window_location: http://www.onenew.net/users/one/invited
  stacktrace: TypeError: Cannot read property 'assignBrowse' of null
    at http://www.onenew.net/assets/admin-33f8

(Arpit Jalan) #26

@eviltrout fixed this issue:

https://github.com/discourse/discourse/commit/7069ee16e2ef32a6be9675148e11184dfd3eab28

Update your Discourse instance, this should be fixed now.


(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.

Email,Group,topic_id
name@adomain.com,open-data;general-discussion,101

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

Group - http://talk.beta.nyc/c/working-groups/open-data
Topic - http://talk.beta.nyc/t/what-nyc-weather-related-environmental-data-would-you-like-released-as-open-data/101/2

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

Thanks


(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:

http://talk.beta.nyc/groups/open-data
http://talk.beta.nyc/groups/general-discussion

(Compare to Talk | New York Civic Technology News & Discussion group hosted by BetaNYC, which does exist. Note that the ‘admin’ group is special - it’s calculated, and it’s special-cased in the inviter to grant admin.)