Add new user to Group

Hi,

Is it possible to automatically add a new user who just created an account to a specific Group in Groups?

Best regards,
Nicolai

Posted in

Comments

3 responses to “Add new user to Group”

  1. Hey Nicolai,

    Please feel free to modify the code as you wish. It is possible to add the user to a group according to the email domain, but for this you need to add additional checks, like first fetching the email, extracting the domain and create a new group if it doesn’t already exist.

    Kind regards,
    George

  2. Nicolai Lund Avatar
    Nicolai Lund

    Cool – many thanks. 😉

    Would it be possible to modify the code, so the group associated with anew user is dependent on the domain the users email is belonging to?

    F.x. Xyz@microsoft.com would be associated to the group called Microsoft? Or abc@whatever.com would be linked to a default group?

    Best regards
    Nicolai

  3. Hi Nicolai,

    Welcome to our support forum and many thanks for using Groups plugin and its addons on your site.
    A new user can be automatically added to a group only with a custom addon but you can use something similar to this one I keep on GitHub which automatically adds new customers to Customers group. If you like you can remove lines 43,44,45,47 and add the group name of your choice on line 46 instead of Customers.
    Hope it helps.

    Kind regards,
    George

Share