Multisite welcome emails customization

I want to customize my multisite user notification emails. Here are customizations I'm looking for:
01. Email notification customization :
I. To name
II. Ability to auto insert password

02. Ability enable/disable automated email notifications (especially for manually created users)

  • Ash
    • WordPress Hacker

    Hello Aaqib

    For the first part, use the following code:

    add_filter( 'update_welcome_user_email', function( $welcome_email, $user_id, $password, $meta ) {
    	$user = new WP_User( $user_id );
    	$text = 'Howdy USERNAME,
    Your new account is set up.
    You can log in with the following information:
    Name: ' . $user->display_name . '
    Username: USERNAME
    Password: PASSWORD
    --The Team @ SITE_NAME';
    return $text;
    }, 99, 4 );

    You can use this code in your child theme's functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    For second part, when you manually add an user to the site, just check the box for skipping email like the following screenshot:

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.