Add new user to Group

Posted in

Hi,

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

Best regards,
Nicolai

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,
    George

  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. 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. 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,
    George

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

AffiliatesContactJobsTerms & ConditionsPrivacy PolicyDocumentationDownloadsUseful PluginsMy Account

Share