How to send an email confirmation to the registered user through Wordpress?

2

I have this registration routine and need to send an email confirmation when the user registers, how can I do it?

// SETUP NEW USER
$data = array(
    'display_name'  => esc_attr($_POST['display_name']),
    'user_login' => esc_attr($_POST['user_login']),
    'user_email' => esc_attr($_POST['email']),
    'user_pass'  => esc_attr($_POST['user_pass']),
    'game_pass'  => esc_attr($_POST['game_pass']),
    'role'       => get_option('default_role'),
);

$new_user = wp_insert_user($data);
wp_new_user_notification($new_user, $user_pass);
    
asked by anonymous 01.05.2014 / 17:25

1 answer

1

To send email with WP you can do this:

<?php
$to = "[email protected]";
$subject = "Learning how to send an Email in WordPress";
$content = "WordPress knowledge";

$status = wp_mail($to, $subject, $content);

Only add your logic as needed.

    
02.05.2014 / 13:55