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.