Hi @forprof,
We checked on our staging site and there is not occurred any issue like that but we are providing you a snippet of code it may be resolved. Please add this code snippet in the functions.php file to the child theme.
$my_class = pw_new_user_approve::instance();
remove_action( 'user_register', array( $my_class, 'request_admin_approval_email_2' ) );
add_action('user_register', 'nua_admin_approval_email');
function nua_admin_approval_email($user_id) {
$user = new WP_User( $user_id );
$user_login = stripslashes( $user->data->user_login );
$user_email = stripslashes( $user->data->user_email );
admin_approval_emails( $user_login, $user_email );
}
function admin_approval_emails( $user_login, $user_email ) {
$default_admin_url = admin_url( 'users.php?s&pw-status-query-submit=Filter&new_user_approve_filter=pending&paged=1' );
$admin_url = apply_filters( 'new_user_approve_admin_link', $default_admin_url );
/* send email to admin for approval */
$message = apply_filters( 'new_user_approve_request_approval_message_default', nua_default_notification_message() );
$message = nua_do_email_tags( $message, array(
'context' => 'request_admin_approval_email',
'user_login' => $user_login,
'user_email' => $user_email,
'admin_url' => $admin_url,
) );
$message = apply_filters(
'new_user_approve_request_approval_message',
$message,
$user_login,
$user_email
);
$subject = sprintf( __( '[%s] User Approval', 'new-user-approve' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) );
$subject = apply_filters( 'new_user_approve_request_approval_subject', $subject );
$to = apply_filters( 'new_user_approve_email_admins', array( get_option( 'admin_email' ) ) );
$to = array_unique( $to );
// send the mail
wp_mail(
$to,
$subject,
$message,
nua_email_header()
);
}
function nua_email_header() {
$admin_email = get_option( 'admin_email' );
if ( isset($_SERVER['SERVER_NAME']) && empty($admin_email) ) {
$admin_email = 'support@' . sanitize_text_field(wp_unslash($_SERVER['SERVER_NAME']));
}
$from_name = get_option( 'blogname' );
$headers = array( "From: \"{$from_name}\" <{$admin_email}>\n" );
$headers = apply_filters( 'new_user_approve_email_header', $headers );
return $headers;
}
Please let me know if you still have any issues.
Thank you