wpmu_welcome_user_notification

The timeline below displays how wordpress function wpmu_welcome_user_notification has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Notifies a user that their account activation has been successful.
 *
 * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.
 *
 * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to
 * modify the content and subject line of the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int    $user_id  User ID.
 * @param string $password User password.
 * @param array  $meta     Optional. Signup meta data. Default empty array.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_network = get_network();
    /**
     * Filters whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU (3.0.0)
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data. Default empty array.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    $switched_locale = switch_to_user_locale($user_id);
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU (3.0.0)
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data. Default empty array.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_network->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ('' === $admin_email) {
        $admin_email = 'support@' . wp_parse_url(network_home_url(), PHP_URL_HOST);
    }
    $from_name = ('' !== get_site_option('site_name')) ? esc_html(get_site_option('site_name')) : 'WordPress';
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_network->site_name)) {
        $current_network->site_name = 'WordPress';
    }
    /* translators: New user notification email subject. 1: Network title, 2: New user login. */
    $subject = __('New %1$s User: %2$s');
    /**
     * Filters the subject of the welcome email after user activation.
     *
     * @since MU (3.0.0)
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf($subject, $current_network->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    if ($switched_locale) {
        restore_previous_locale();
    }
    return true;
}

WordPress Version: 6.1

/**
 * Notifies a user that their account activation has been successful.
 *
 * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.
 *
 * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to
 * modify the content and subject line of the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int    $user_id  User ID.
 * @param string $password User password.
 * @param array  $meta     Optional. Signup meta data. Default empty array.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_network = get_network();
    /**
     * Filters whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU (3.0.0)
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data. Default empty array.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    $switched_locale = switch_to_locale(get_user_locale($user));
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU (3.0.0)
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data. Default empty array.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_network->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ('' === $admin_email) {
        $admin_email = 'support@' . wp_parse_url(network_home_url(), PHP_URL_HOST);
    }
    $from_name = ('' !== get_site_option('site_name')) ? esc_html(get_site_option('site_name')) : 'WordPress';
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_network->site_name)) {
        $current_network->site_name = 'WordPress';
    }
    /* translators: New user notification email subject. 1: Network title, 2: New user login. */
    $subject = __('New %1$s User: %2$s');
    /**
     * Filters the subject of the welcome email after user activation.
     *
     * @since MU (3.0.0)
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf($subject, $current_network->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    if ($switched_locale) {
        restore_previous_locale();
    }
    return true;
}

WordPress Version: 5.5

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.
 *
 * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to
 * modify the content and subject line of the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int    $user_id  User ID.
 * @param string $password User password.
 * @param array  $meta     Optional. Signup meta data. Default empty array.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_network = get_network();
    /**
     * Filters whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU (3.0.0)
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data. Default empty array.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    $switched_locale = switch_to_locale(get_user_locale($user));
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU (3.0.0)
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data. Default empty array.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_network->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ('' === $admin_email) {
        $admin_email = 'support@' . wp_parse_url(network_home_url(), PHP_URL_HOST);
    }
    $from_name = ('' !== get_site_option('site_name')) ? esc_html(get_site_option('site_name')) : 'WordPress';
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_network->site_name)) {
        $current_network->site_name = 'WordPress';
    }
    /* translators: New user notification email subject. 1: Network title, 2: New user login. */
    $subject = __('New %1$s User: %2$s');
    /**
     * Filters the subject of the welcome email after user activation.
     *
     * @since MU (3.0.0)
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf($subject, $current_network->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    if ($switched_locale) {
        restore_previous_locale();
    }
    return true;
}

WordPress Version: 5.4

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.
 *
 * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to
 * modify the content and subject line of the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int    $user_id  User ID.
 * @param string $password User password.
 * @param array  $meta     Optional. Signup meta data. Default empty array.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_network = get_network();
    /**
     * Filters whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU (3.0.0)
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data. Default empty array.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    $switched_locale = switch_to_locale(get_user_locale($user));
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU (3.0.0)
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data. Default empty array.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_network->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ('' == $admin_email) {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_network->site_name)) {
        $current_network->site_name = 'WordPress';
    }
    /* translators: New user notification email subject. 1: Network title, 2: New user login. */
    $subject = __('New %1$s User: %2$s');
    /**
     * Filters the subject of the welcome email after user activation.
     *
     * @since MU (3.0.0)
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf($subject, $current_network->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    if ($switched_locale) {
        restore_previous_locale();
    }
    return true;
}

WordPress Version: 5.3

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.
 *
 * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to
 * modify the content and subject line of the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int    $user_id  User ID.
 * @param string $password User password.
 * @param array  $meta     Optional. Signup meta data. Default empty array.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_network = get_network();
    /**
     * Filters whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU (3.0.0)
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data. Default empty array.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    $switched_locale = switch_to_locale(get_user_locale($user));
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU (3.0.0)
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data. Default empty array.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_network->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_network->site_name)) {
        $current_network->site_name = 'WordPress';
    }
    /* translators: New user notification email subject. 1: Network title, 2: New user login. */
    $subject = __('New %1$s User: %2$s');
    /**
     * Filters the subject of the welcome email after user activation.
     *
     * @since MU (3.0.0)
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf($subject, $current_network->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    if ($switched_locale) {
        restore_previous_locale();
    }
    return true;
}

WordPress Version: 5.1

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.
 *
 * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to
 * modify the content and subject line of the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int    $user_id  User ID.
 * @param string $password User password.
 * @param array  $meta     Optional. Signup meta data. Default empty array.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_network = get_network();
    /**
     * Filters whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU (3.0.0)
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data. Default empty array.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    $switched_locale = switch_to_locale(get_user_locale($user));
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU (3.0.0)
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data. Default empty array.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_network->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_network->site_name)) {
        $current_network->site_name = 'WordPress';
    }
    /* translators: New user notification email subject. 1: Network name, 2: New user login */
    $subject = __('New %1$s User: %2$s');
    /**
     * Filters the subject of the welcome email after user activation.
     *
     * @since MU (3.0.0)
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf($subject, $current_network->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    if ($switched_locale) {
        restore_previous_locale();
    }
    return true;
}

WordPress Version: 4.9

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.
 *
 * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to
 * modify the content and subject line of the notification email.
 *
 * @since MU (3.0.0)
 *
 * @param int    $user_id  User ID.
 * @param string $password User password.
 * @param array  $meta     Optional. Signup meta data. Default empty array.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_network = get_network();
    /**
     * Filters whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU (3.0.0)
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data. Default empty array.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    $switched_locale = switch_to_locale(get_user_locale($user));
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU (3.0.0)
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data. Default empty array.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_network->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_network->site_name)) {
        $current_network->site_name = 'WordPress';
    }
    /* translators: New user notification email subject. 1: Network name, 2: New user login */
    $subject = __('New %1$s User: %2$s');
    /**
     * Filters the subject of the welcome email after user activation.
     *
     * @since MU (3.0.0)
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf($subject, $current_network->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    if ($switched_locale) {
        restore_previous_locale();
    }
    return true;
}

WordPress Version: 4.8

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.
 *
 * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to
 * modify the content and subject line of the notification email.
 *
 * @since MU
 *
 * @param int    $user_id  User ID.
 * @param string $password User password.
 * @param array  $meta     Optional. Signup meta data. Default empty array.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_network = get_network();
    /**
     * Filters whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data. Default empty array.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    $switched_locale = switch_to_locale(get_user_locale($user));
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data. Default empty array.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_network->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_network->site_name)) {
        $current_network->site_name = 'WordPress';
    }
    /* translators: New user notification email subject. 1: Network name, 2: New user login */
    $subject = __('New %1$s User: %2$s');
    /**
     * Filters the subject of the welcome email after user activation.
     *
     * @since MU
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf($subject, $current_network->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    if ($switched_locale) {
        restore_previous_locale();
    }
    return true;
}

WordPress Version: 4.7

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.
 *
 * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to
 * modify the content and subject line of the notification email.
 *
 * @since MU
 *
 * @param int    $user_id
 * @param string $password
 * @param array  $meta     Optional. Not used in the default function, but is passed along to hooks for customization.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_network = get_network();
    /**
     * Filters whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    $switched_locale = switch_to_locale(get_user_locale($user));
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_network->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_network->site_name)) {
        $current_network->site_name = 'WordPress';
    }
    /* translators: New user notification email subject. 1: Network name, 2: New user login */
    $subject = __('New %1$s User: %2$s');
    /**
     * Filters the subject of the welcome email after user activation.
     *
     * @since MU
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf($subject, $current_network->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    if ($switched_locale) {
        restore_previous_locale();
    }
    return true;
}

WordPress Version: 4.6

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass.
 *
 * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to
 * modify the content and subject line of the notification email.
 *
 * @since MU
 *
 * @param int    $user_id
 * @param string $password
 * @param array  $meta     Optional. Not used in the default function, but is passed along to hooks for customization.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_site = get_current_site();
    /**
     * Filters whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_site->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_site->site_name)) {
        $current_site->site_name = 'WordPress';
    }
    /**
     * Filters the subject of the welcome email after user activation.
     *
     * @since MU
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf(__('New %1$s User: %2$s'), $current_site->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    return true;
}

WordPress Version: 4.5

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter 'wpmu_welcome_user_notification' to disable or bypass.
 *
 * Filter 'update_welcome_user_email' and 'update_welcome_user_subject' to
 * modify the content and subject line of the notification email.
 *
 * @since MU
 *
 * @param int    $user_id
 * @param string $password
 * @param array  $meta     Optional. Not used in the default function, but is passed along to hooks for customization.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_site = get_current_site();
    /**
     * Filter whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    /**
     * Filters the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU
     *
     * @param string $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_site->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_site->site_name)) {
        $current_site->site_name = 'WordPress';
    }
    /**
     * Filter the subject of the welcome email after user activation.
     *
     * @since MU
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf(__('New %1$s User: %2$s'), $current_site->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    return true;
}

WordPress Version: 4.3

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter 'wpmu_welcome_user_notification' to disable or bypass.
 *
 * Filter 'update_welcome_user_email' and 'update_welcome_user_subject' to
 * modify the content and subject line of the notification email.
 *
 * @since MU
 *
 * @param int    $user_id
 * @param string $password
 * @param array  $meta     Optional. Not used in the default function, but is passed along to hooks for customization.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_site = get_current_site();
    /**
     * Filter whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    /**
     * Filter the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU
     *
     * @param type   $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_site->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_site->site_name)) {
        $current_site->site_name = 'WordPress';
    }
    /**
     * Filter the subject of the welcome email after user activation.
     *
     * @since MU
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf(__('New %1$s User: %2$s'), $current_site->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    return true;
}

WordPress Version: 3.9

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter 'wpmu_welcome_user_notification' to disable or bypass.
 *
 * Filter 'update_welcome_user_email' and 'update_welcome_user_subject' to
 * modify the content and subject line of the notification email.
 *
 * @since MU
 *
 * @param int $user_id
 * @param string $password
 * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_site = get_current_site();
    /**
     * Filter whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    /**
     * Filter the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU
     *
     * @param type   $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_site->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_site->site_name)) {
        $current_site->site_name = 'WordPress';
    }
    /**
     * Filter the subject of the welcome email after user activation.
     *
     * @since MU
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf(__('New %1$s User: %2$s'), $current_site->site_name, $user->user_login));
    wp_mail($user->user_email, wp_specialchars_decode($subject), $message, $message_headers);
    return true;
}

WordPress Version: 3.8

/**
 * Notify a user that their account activation has been successful.
 *
 * Filter 'wpmu_welcome_user_notification' to disable or bypass.
 *
 * Filter 'update_welcome_user_email' and 'update_welcome_user_subject' to
 * modify the content and subject line of the notification email.
 *
 * @since MU
 *
 * @param int $user_id
 * @param string $password
 * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    $current_site = get_current_site();
    /**
     * Filter whether to bypass the welcome email after user activation.
     *
     * Returning false disables the welcome email.
     *
     * @since MU
     *
     * @param int    $user_id  User ID.
     * @param string $password User password.
     * @param array  $meta     Signup meta data.
     */
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    /**
     * Filter the content of the welcome email after user activation.
     *
     * Content should be formatted for transmission via wp_mail().
     *
     * @since MU
     *
     * @param type   $welcome_email The message body of the account activation success email.
     * @param int    $user_id       User ID.
     * @param string $password      User password.
     * @param array  $meta          Signup meta data.
     */
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_site->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_site->site_name)) {
        $current_site->site_name = 'WordPress';
    }
    /**
     * Filter the subject of the welcome email after user activation.
     *
     * @since MU
     *
     * @param string $subject Subject of the email.
     */
    $subject = apply_filters('update_welcome_user_subject', sprintf(__('New %1$s User: %2$s'), $current_site->site_name, $user->user_login));
    wp_mail($user->user_email, $subject, $message, $message_headers);
    return true;
}

WordPress Version: 3.7

/**
 * Notify a user that her account activation has been successful.
 *
 * Filter 'wpmu_welcome_user_notification' to disable or bypass.
 *
 * Filter 'update_welcome_user_email' and 'update_welcome_user_subject' to
 * modify the content and subject line of the notification email.
 *
 * @since MU
 *
 * @param int $user_id
 * @param string $password
 * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization.
 * @return bool
 */
function wpmu_welcome_user_notification($user_id, $password, $meta = array())
{
    global $current_site;
    if (!apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta)) {
        return false;
    }
    $welcome_email = get_site_option('welcome_user_email');
    $user = get_userdata($user_id);
    $welcome_email = apply_filters('update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
    $welcome_email = str_replace('SITE_NAME', $current_site->site_name, $welcome_email);
    $welcome_email = str_replace('USERNAME', $user->user_login, $welcome_email);
    $welcome_email = str_replace('PASSWORD', $password, $welcome_email);
    $welcome_email = str_replace('LOGINLINK', wp_login_url(), $welcome_email);
    $admin_email = get_site_option('admin_email');
    if ($admin_email == '') {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = (get_site_option('site_name') == '') ? 'WordPress' : esc_html(get_site_option('site_name'));
    $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = $welcome_email;
    if (empty($current_site->site_name)) {
        $current_site->site_name = 'WordPress';
    }
    $subject = apply_filters('update_welcome_user_subject', sprintf(__('New %1$s User: %2$s'), $current_site->site_name, $user->user_login));
    wp_mail($user->user_email, $subject, $message, $message_headers);
    return true;
}