• Hello,

    How can I change programmatically URL redirect after email activation?

    I’m talking about “URL redirect after e-mail activation” in the User Role Registration Options but want to set this dynamically in the code depending on the user choices.

    Thank you in advance.

    All the best,
    Patrick

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Aswin Giri

    (@aswingiri)

    Hello @kodomastro

    You can try to use this filter to change redirect url after email confirmation:

    apply_filters( 'um_after_email_confirmation_redirect', $redirect, $user_id, $login );

    If you also want to run some function before redirection, you can use this:
    do_action( 'um_after_email_confirmation', $user_id );

    Thanks for this idea.

    I am trying the same.

    With registration, I save an url of the new member. This is a field in registration form (“url_before_registration”).

    After clicking the activation link, the customer should get to this url. But I cannot retrieve the information from profile.

    I tried like that:

    add_filter('um_after_email_confirmation_redirect', 'hsseq4u_redirection_url', 10, 3);
    
    function hsseq4u_redirection_url() {
    	$url_before_registration = um_user('url_before_registration');
    	if(!empty($url_before_registration)) {
    		return $url_before_registration; 
    	} else { 
    		return 'https://www.DOMAIN.com/TEST';
    	}
    }

    New customers always get to the TEST link.

    Seems like it was another problem and just the custom field was not saved correctly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Dynamic change of URL redirect after email activation’ is closed to new replies.