Forums

How to send user's information to some email right after registration (2 posts)

  1. dailyoffs
    Member
    Posted 6 months ago #

    I am developing a simple plugin to send user's information (in the header) to a specific email right after registration.

    This is what I wrote, but for some reason it does not work.

    function sendemail($user_id)
    {
    $new_user = get_userdata($user_id);
    
    $headers = 'From: ' . $new_user->display_name . ' <' . $new_user->user_email . '>' . "\r\n";
    
    wp_mail('email@domain.com', 'subject', 'message', $headers);
    }
    
    // Now we set that function up to execute when the user_register action is called
    
    add_action('user_register', 'sendemail');

    Any help?

  2. dailyoffs
    Member
    Posted 6 months ago #

    Any idea? I need to get this working. Any help would be much appreciated.

Reply

You must log in to post.

About this Topic