• Resolved mungbean

    (@mungbean)


    I would like to create groups for individual universities.

    Assuming I create a rules list or taxonomy linking a university email domain to a university name (ie. @gumpert.edu == Gumpert College), when a user registers with their .edu email, can I have them automatically added to the corresponding university group?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Kento

    (@proaktion)

    Hi,

    That would indeed be possible if you implement it e.g. using the action hook that fires when a new user is created.

    This is how you would outline the implementation:

    add_action( 'user_register', 'my_domain_based_user_register' );
    
    function my_domain_based_user_register( $user_id ) {
        // 1. check the email for its domain
        // 2. create a new group if it doesn't exist for the domain
        // 3. add the new user to the group
    }

    The API documentation has some examples that should help.

    Cheers

    Thread Starter mungbean

    (@mungbean)

    Thanks. I will look further into this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Auto join group based on email domain’ is closed to new replies.