0

Hello :) I am hoping someone can help me resolve my issue or guide me in the right direction to resolve it. On my WordPress website, I would like to know how to edit the new user email template that I manually created and that is sent to new users. here is an example: enter image description here

Does anyone know where i can find this template and customize it to add my own content? I would really appreciate any support regarding this topic :)

Thank you!

1 Answer 1

0

This is done with the register_new_user filter:

// Replace the default new user notification
remove_action('register_new_user', 'wp_send_new_user_notifications');
add_action('register_new_user', 'my_new_user_email');

You have to remove the default action and register the new function:

Create a new function that builds and sends the message.

function my_new_user_email($user_id, $deprecated = null, $notify = 'user') {
   // create the message
    $message = "Hello new user!";

    // Send the email
    wp_mail(get_userdata($user_id)->user_email, 'Custom Subject', $message);
}

This is placed in the functions.php file of your Child Theme (not the main theme, as any theme update will overwrite your changes).

Make the desired changes to the message text. Add headers to allow for an HTML message. (Lots of googles/bings/ducks on how to do that.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.