How to approve automatically after registration?
-
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
- The topic ‘How to approve automatically after registration?’ is closed to new replies.