By Andy on Wednesday, 09 September 2020
Posted in Technical Issues
Likes 0
Views 581
Votes 0
Really hoping you can help me with this one.... Is it a simple PHP command or commands to programmatically add a known User ID to a known Group ID?

Because of the way my site works I want to be able to automatically add someone to a group when they complete a (non EasySocial form)....

Thanks.
Do you mean that you have another registration form on the site?

If yes, you can use this following code to add that new registered user into specific group.


// $id variable is your group id
$cluster = ES::cluster($id);

// $userId variable is that new register user id
$cluster->createMember($userId, true);
·
Wednesday, 09 September 2020 13:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Awesome. Thank you.
·
Wednesday, 09 September 2020 20:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Wednesday, 09 September 2020 22:31
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post