Confirm email change via unique link - for existing user account

Support MB User Profile Confirm email change via unique link - for existing user accountResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #44082
    CodogCodog
    Participant

    Hi there,
    I would really like to be able to validate/confirm an account email change by a registered user, using the same/similar method provided by the registration process (mb-user-profile/confirmation-email.php).

    IE: A unique link is sent to the existing user to verify the email change before it can be used to log back in?

    Would this be possible using the rwmb_profile_after_process or rwmb_profile_before_process actions?

    As a very rough concept, I was thinking something like...

    add_action( 'rwmb_profile_before_process', function( $config, $user_id ) {
        if ( 'user-profile' === $config['id'] ) {
    		$link = '<a href="'.esc_url( $data->confirm_link ).'" target="_blank">'.esc_html_e( 'Confirm Account', 'mb-user-profile' ).'</a></p>';
            wp_mail( '[email protected]', 'Confirm email change!', $link );
    		wp_safe_redirect( 'login' );
    		wp_logout();
            die;
        }
    }, 10, 2 );

    Any help appreciated. I look forward to your response.

    #44086
    PeterPeter
    Moderator

    Hello,

    Thank you for your feedback.

    This feature is not supported in the frontend. I will inform the development team to consider supporting this in future updates.

    #44091
    CodogCodog
    Participant

    Thanks for getting back to me Peter. Ok, I will write my own function for that task.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.