Almost Finished!

$new_user_email, 'user_email' => $new_user_email, 'first_name' => $new_user_first_name, 'last_name' => $new_user_last_name, 'role' => 'subscriber' ); $new_user_id = wp_insert_user($user_data); if (!is_wp_error($new_user_id)) { $activation_link = get_permalink(get_page_by_path('email-verification')).'?email='.$new_user_email.'&hash='.$confirmaion_hash_key; $email_content = "A mail has been sent to your email address. Please follow the link to activate your account"; update_user_meta($new_user_id,'activated','false'); $to = $new_user_email; // Send email to our user $subject = 'Signup Verification'; // Give the email a subject $message = 'Your login credential'; $message .= 'Username: '.$new_user_email.'
Password: '.$new_user_password.'
Please click on the following link or copy the link and paste it to your browser to activate your profile and Sign in.' .$activation_link.'; // Our message above including the link $headers = "From: " Your Name .\r\n"; $headers .= "Reply-To: "Your Email"\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $headers .= "Content-Transfer-Encoding: 7BIT"; wp_mail($to, $subject, $message, $headers); // Send our email } else { if (isset($new_user_id->errors['empty_user_login'])) { $notice_key = 'User Name and Email are mandatory'; echo $notice_key; } elseif (isset($new_user_id->errors['existing_user_login'])) { echo'

User name already exixts.

'; } else { echo'

Error Occured please fill up the sign up form carefully.

'; } } else: echo 'You have not submitted the form'; endif;