0
votes

I am looking to customise the content of the email that goes out to new users when I add them to our wordpress intranet site.

It currently says:

Subject: [Website name] Your username and password info Username: "username" To set your password, visit the following address:

<https://"url"/wp-login.php?action=rp&key=....>

https://url/account-sign-in/

But I would like it to be a bit more user friendly (welcome to ... etc etc) as this is a new intranet for staff.

I have searched online but all the answers I have found are very confusing! How do I change this?

1

1 Answers

2
votes

You should use the wp_new_user_notification_email_admin filter hook.

This passes an array of arguments that you can alter and then you need to return the arguments at the end of the function. An example of this:

add_filter( 'wp_new_user_notification_email_admin', 'so_alter_new_user_email', 10, 3 );

function so_alter_new_user_email( $email, $user, blog ) {

    $email['message'] = 'Welcome!';

    return $email;

}

That will change the new user email to just say Welcome!

wp_new_user_notification_email_admin hook documentation.