Add new user to Group

Posted in


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

Best regards,

3 Responses to Add new user to Group

  1. George August 11, 2020 at 8:09 pm #

    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,

  2. Nicolai Lund August 10, 2020 at 7:53 pm #

    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. would be associated to the group called Microsoft? Or would be linked to a default group?

    Best regards

  3. George August 10, 2020 at 4:37 pm #

    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,

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account