Plugin support for creating groups

AI-generated summary

The discussion revolves around implementing plugin support for creating groups in Discourse. wichall seeks guidance on automatically creating a new group for each inviter when sending invitations, with invitees added to the newly created group. vinothkannans clarifies that while group assignment during invitations exists, it only applies to existing groups. wichall emphasizes the need for automatic, non-optional creation of new groups tied to the inviter. vinothkannans suggests directly calling the GroupsController methods from the plugin or referencing the save_group method in the Discourse source code, noting that the Discourse API is more suitable for external applications.

Hello, I’m totally new to discourse and have tried to get myself stuck in to making a plugin straight away.

Starting to work my around, but can anyone tell me what the best method would be for creating a new group within my plugin?

The end goal is to automatically add invitees to groups, created for each individual inviter.

Would it be best to directly call the GroupsController class or do some sort of post via the js?

This feature already available while sending invitations.

Thanks for the fast reply!

Yes it is, but only to existing groups.

I want invitees to automatically be added to a newly created group referencing the inviter (if it’s the inviter’s first invite).

I want this to be automatic, non-optional, separate from the existing optional functionality.

You can call GroupsController methods directly from your plugin. Else you can copy codes from save_group method from discourse/app/controllers/admin/groups_controller.rb at main · discourse/discourse · GitHub.

It (Discourse API) will be useful if your creating group from another separate application.