I have following piece of code, which inserts usernames and other details of users in the database. After inserting the usernames I want to email them using
wp_mail();. I am unable to do so. How can I do this?
$member_details->user_login = array_map( 'sanitize_text_field', $_POST['user_login'] ); $member_details->user_role = array_map( 'sanitize_text_field', $_POST['user_role'] ); $member_details->status = array_map( 'sanitize_text_field', $_POST['status'] ); $member_details_encode = wp_json_encode( $member_details ); global $wpdb; $member_result = $wpdb->insert( 'wpxa_project_members', array( 'project_id' => $_SESSION['project_id'], 'author_id' => $post_author, 'member_details' => $member_details_encode ), array( '%d', '%d', '%s' ) );