Support » Plugin: Ultimate Member – User Profile, User Registration, Login & Membership Plugin » How to approve automatically after registration?

  • Resolved neueweide

    (@neueweide)


    I’m trying to hook into the um_registration_complete to check the eMail Domain of a User registering. If he has a defined Domain in his Mail i want to approve him automatically.
    Let’s say all Users with a Mail Address ending with @my-domain.com should be approved automatically. All others should be approved manually by an Administrator.

    i always ended up with a critical error… in my browser

    here a very basic approuch i tried in my functions.php:

    um_fetch_user( 53 );
    echo um_user('display_name');
    UM()->user()->set_role( 'um_my-custom-role' );
    UM()->user()->approve();

    the echo line is showing correctly the display_name of the user with the ID: 53
    But the next two lines causes an critical error.

    please give me some advice how to fix this.
    best
    robert

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to approve automatically after registration?’ is closed to new replies.