Assign group based on email

Posted in

Hi folks, I’m trying to get groups to assign a group based on an email address. Is this possible? My website has different products for different clients and it would be great if people registering an account from business ‘x’ or business ‘y’ would automatically be assigned to a group.

3 Responses to Assign group based on email

  1. George May 10, 2019 at 1:19 pm #

    At least for the time being you can only implement that feature. If it existed, you would already be able to use it.

    Kind regards,
    George

  2. George May 4, 2019 at 12:43 pm #

    Hi,

    I would say that it can be done. How I would build it would be something like the following:
    1. Get the email of the new user
    2. Check if a group for that domain exists, if not create that group.
    3. Check if the user belongs to that group already, if not assign him/her to that group.

    FYI, these resources will be useful for the implementation.
    Groups API
    Examples
    Check if a group exists
    Check if a user belongs to a group

    Kind regards,
    George

    • plumpmedia May 8, 2019 at 2:20 am #

      Hi George,

      Thanks for the reply. So I guess that means no easy way for a non-programmer?

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

Share