Invite individual users to a group


(Sam Saffron) #1

Users may be invited to the site and prestaged in a group.

Upon account creation the user will be added to this group.

This feature is useful when you wish to invite a group of private beta testers, employees, etc.

This feature is only available to forum admins

Using the UI:

Using the API:

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

client.invite_user_to_topic(topic_id: 1, email: "bob@bob.com", group_ids: "1,2,3")
client.invite_user_to_topic(topic_id: 1, email: "bob@bob.com", group_names: "bugs,cars,testers")

Limitations

At the moment you may not invite users to predefined groups such as, trust level groups, admin, mod or staff groups.


Inviting users to secure topics
Allow group owners to invite users to a group they own in the initial invite
(Kane York) #2

[quote=“sam, post:1, topic:15544”]Limitations

At the moment you may not invite users to predefined groups such as, trust level groups, admin, mod or staff groups.
[/quote]

What if I want to invite someone into the everyone group, huh? What then? :stuck_out_tongue:

Jokes aside, I think that is a reasonable restriction. Giving someone an invite that instantly makes them an admin might not be the best idea in general, and it would be impossible to deduce intent from inviting into staff.

Glad to see this completed!


(Steve Baer) #3

Is the topic_id the topic that will be sent as the email body?


(Sam Saffron) #4

Yes, that would be it, try it out :slight_smile:


(Manoj Lamba) #5

How do you use the UI to BULK invite people to the same group? It seems like its all one-by-one?

If so, tips on how to use the API to do this?


(Sam Saffron) #6

use the API for it, its linked above.


(Tobias Eigen) #7

I love this - well done. I have been trying it out and it’s working really well.

One oddity (is that the right word?) is that I don’t see the INVITE link on topics in private categories… only on topics in public categories. This means I can’t invite someone to join my private category and add them to my private group to access that category at the same time.

I also would very much like to be able to add a brief note to the invite to give the invitee some context.


(Sam Saffron) #8

Indeed, that is a bug :slight_smile: will get it fixed.


(Jeff Atwood) #9

I moved 17 posts to a new topic: Some proposed improvements to user invites


(Blake Erickson) #26

Incase anyone is trying to use the API, here is a correction to @sam’s example:

topic_invite_user should be invite_user_to_topic

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

client.invite_user_to_topic(topic_id: 1, email: "bob@bob.com", group_ids: "1,2,3")
client.invite_user_to_topic(topic_id: 1, email: "bob@bob.com", group_names: "bugs,cars,testers")

Invitations to group-restricted topics
(Utkarsh Agarwal) #27

Is it possible to for group members/private topic members to invite other members into it? Haven’t been able to find a way yet.


(Caue Rego) #28

I believe only admins can invite.

No idea why this would only for admins, though. I think it makes sense allowing anyone to invite, doesn’t it?

Maybe it’s “just” a matter of properly setting permissions and it’s a lot of work to do…


(Kane York) #29

If you have local logins disabled, you’ll see that behavior, because you can’t be sure that the person has an account on whatever login service you have set up.


(Caue Rego) #30

D’oh, I’m no admin and the invite button is right there (here on meta).

<— Stupid! :stuck_out_tongue:


(Shoaib Amir) #31

@cregox Where ? i can’t find any invite button.

How can i activate invitation feature for new user so that they can invite other member.

Actually I want to keep my discourse on invitation base only, so that only specific member with specific experience can join.

My forum is about Shipping and Logistics only.
you can have a look and advise me improvement please.

CargoTalks.com