批量发送用户邀请

:bookmark: This guide explains how to invite multiple users to your Discourse instance using a bulk invite feature.

:person_raising_hand: Required user level: Administrator

Inviting a large number of users to your Discourse instance can be time-consuming if done individually. Fortunately, Discourse offers a bulk invite feature that allows you to invite multiple users at once. This guide will walk you through the process of sending bulk invites.

:information_source: It is not possible to invite users to predefined groups such as, trust level groups, admin, mod or staff groups. As a work around, you can configure a custom group to automatically set a users trust level in the Effects section of the group’s configuration page. Doing this will allow you to set the trust level of invited users to a trust level other than what is set by your site’s default invitee trust level setting

Overview

  1. Enable the Allow bulk invite site setting
  2. Prepare a CSV file with user information
  3. Upload the CSV file to your Discourse instance
  4. Monitor the bulk invite progress

Enable the Allow bulk invite site setting

  1. Navigate to your site settings at Admin > :gear: All site settings, and search for bulk invite. Or go to {your.domain.com}/admin/site_settings/category/all_results?filter=bulk%20invite
  2. If not already enabled, tick the box beside Allow bulk invite and click the check mark to save the site setting.

Preparing the CSV file

The first step is to create a CSV (Comma-Separated Values) file containing the information of the users you want to invite. Here’s what you need to know:

  • Each line represents one user
  • The email address is required and must be in the first column
  • Group assignments (optional) go in the second column
  • A specific topic ID (optional) goes in the third column

Here’s the structure of the CSV file:

email,groups,topic_id

CSV file guidelines

  • Email addresses must be valid
  • Separate multiple groups with semicolons (e.g., group_1;group_2;group_3)
  • You can include existing users if you want to add them to groups
  • Only the email is mandatory; groups and topic ID are optional

:information_source: There is a hidden site setting max_bulk_invites which allows 50k rows in a CSV by default

CSV file examples

user1@example.com,group_1;group_2,topic_id
user2@example.com,group_3,
user3@example.com,,

:information_source: You can create CSV files easily using spreadsheet software like Microsoft Excel or Google Sheets. Here’s an example of how it might look in a spreadsheet:

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

Comma Delimited CSV format in Google Sheets

Comma Delimited CSV format in Microsoft Excel

Uploading the CSV file

Once you’ve prepared your CSV file, follow these steps to upload it:

  1. Navigate to the Invites tab on your Admin user’s profile. {your.domain.com}/my/invited/pending

  2. Click the “Bulk Invite from File” button

  3. In the modal that appears, upload your CSV file

  4. Confirm the upload

After uploading, you’ll receive a confirmation message stating that you’ll be notified when the process is complete.

Monitoring bulk invite progress

Once the CSV file is processed, you’ll receive a personal message notification with a progress report. This report will include:

  • Total number of invites sent
  • Number of invites not sent (if any)
  • Any errors that occurred during the process

You can check your invites page on your user profile to see a list of successfully sent invites.

What happens next

Each email address in your CSV file will receive an invite email. The email will include:

  • The name of the person who sent the invite
  • Your community’s title
  • A brief description of your community (from the site description setting)
  • An invitation link

When an invited user clicks the confirmation link:

  • Their account will be immediately activated and associated with their email address
  • They will be added to the specified groups (if any were included in the CSV)
  • They will be directed to the target topic (if a topic ID was specified)

:information_source: Invites that are not clicked will expire after 30 days.

Customizing invite emails

If you wish to customize the text of the invite emails:

  • For general invites, edit the “Invite Forum Mailer” email template
  • For invites that include a specific topic ID, edit the “Invite Mailer” email template

Additional resources

Last edited by @MarkDoerr 2025-09-23T02:11:51Z

Last checked by @hugh 2024-07-11T04:21:44Z

Check documentPerform check on document:
46 个赞

您好,

是否可以像对待现有用户一样,如果用户已有待处理的邀请,则不批量发送电子邮件?

我们上传了一些 CSV 文件,但其中一小部分发生了重叠,导致发送了重复的邀请。

2 个赞

太棒了,感谢分享

也许也应该将此信息添加到本指南中。

2 个赞

完全同意!有两条途径可以使用。将其链接到OP中会很有帮助。

我主要指的是在这里 How to bulk invite and assign groups? 提到之后,向默认组添加用户的功能不起作用。

是的,我明白了。将这个添加到上面的文本中会非常容易。

抱歉提及你 @southpaw(我认为你不会收到此主题的通知,因为它由系统用户拥有),但你上次更新 OP 时可能错过了我们的讨论。

3 个赞

你好 @Moin,

抱歉没有人注意到你的建议!感谢你指出需要将该信息包含在此主题中。我已经添加了。

@nathank,感谢你的提及,无需道歉!

3 个赞