Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter teowim

    (@teowim)

    Hello,

    I just sent an email to support. I prefer using this forum because generally the response is faster than with support. However, I understand that you cannot answer here.

    Thanks!

    Thread Starter teowim

    (@teowim)

    If someone need to do the same thing one day, there is how to do it :

    add_action( 'user_register', 'group_registration_save', 10, 1 );
    
    function group_registration_save($user_id) {
        if (isset( $_POST['email'] )) {
            $email = $_POST['email'];
            $domain = substr(strrchr($email, "@"), 1);
    
        if ($domain === 'xxx.com' || $domain === 'xxx.fr') {
            $group = Groups_Group::read_by_name('Premium');
            if ( $group ) {
                Groups_User_Group::create(array('user_id' => $user_id, 'group_id' => $group->group_id));
            }
        }
    }
Viewing 2 replies - 1 through 2 (of 2 total)