Invite users to a group

:bookmark: This guide explains how to invite users to a group in your Discourse community, covering both staff and group owner methods.

:person_raising_hand: Required user level: Administrator or Group Owner

Forum staff and group owners can create invites to add new and existing users to groups.

This guide will explain:

  • How staff and group owners can send invites to users.
  • Using the Discourse API for user invitations.
  • Sending bulk invitations via CSV upload.

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

Inviting users as staff

Discourse staff can invite both new and existing users to one or more custom groups. Here’s how to do it:

  1. Navigate to your profile page.
  2. Click on “Invites”.
  3. Select the “Add to groups” dropdown to select the groups you want to invite users to.
  4. Invites can be saved as a link that can be shared directly with users by clicking “Save Invite”, or sent via email by clicking click “Save and Send Email”.

See Configuring how users can create and send invites for others to join your community for additional details about sending invites.

Inviting users as a group owner

If you’re a group owner, you can invite new users to the group you own. Follow these steps:

  1. Go to the group’s page.
  2. Click the “Invite” button.

Group owners can also invite existing users to groups using the “Add Users” button.

Using the API

Group invites can also be sent using the Discourse API with the /invites.json API endpoint.

Alternatively, you can use The Discourse API gem to send invites using Ruby.

The following is an API example using the Discourse API Gem:

require 'discourse_api'

client = DiscourseApi::Client.new("somesite", port)
client.api_key = "your key"
client.api_username = "an_admin"

# Invite user by email to specific groups
client.invite_user_to_topic(
  topic_id: 1, 
  email: "bob@bob.com", 
  group_ids: "1,2,3"
)

Bulk Invites

Bulk inviting users can be done by uploading a CSV file. For details about this process, read the detailed guide here: Send Bulk User Invites.

Best practices

  • Create custom groups to organize users based on roles or permissions.
  • Offer clear instructions in your invitation messages to prevent confusion.
  • Regularly review and manage group memberships to maintain an organized community.

Additional resources

Last edited by @SaraDev 2024-07-09T20:00:52Z

Check documentPerform check on document:
14 Likes