Title: newuser_notify_siteadmin
Published: April 25, 2014
Last modified: April 28, 2025

---

# newuser_notify_siteadmin( int $user_id ): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#wp--skip-link--target)

Notifies the network admin that a new user has been activated.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#description)󠁿

Filter [‘newuser_notify_siteadmin’](https://developer.wordpress.org/reference/hooks/newuser_notify_siteadmin/)
to change the content of the notification email.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#parameters)󠁿

 `$user_id`intrequired

The new user’s ID.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#return)󠁿

 bool

## 󠀁[Source](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#source)󠁿

    ```php
    function newuser_notify_siteadmin( $user_id ) {
    	if ( 'yes' !== get_site_option( 'registrationnotification' ) ) {
    		return false;
    	}

    	$email = get_site_option( 'admin_email' );

    	if ( ! is_email( $email ) ) {
    		return false;
    	}

    	$user = get_userdata( $user_id );

    	$options_site_url = esc_url( network_admin_url( 'settings.php' ) );

    	$msg = sprintf(
    		/* translators: New user notification email. 1: User login, 2: User IP address, 3: URL to Network Settings screen. */
    		__(
    			'New User: %1$s
    Remote IP address: %2$s

    Disable these notifications: %3$s'
    		),
    		$user->user_login,
    		wp_unslash( $_SERVER['REMOTE_ADDR'] ),
    		$options_site_url
    	);

    	/**
    	 * Filters the message body of the new user activation email sent
    	 * to the network administrator.
    	 *
    	 * @since MU (3.0.0)
    	 *
    	 * @param string  $msg  Email body.
    	 * @param WP_User $user WP_User instance of the new user.
    	 */
    	$msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user );

    	/* translators: New user notification email subject. %s: User login. */
    	wp_mail( $email, sprintf( __( 'New User Registration: %s' ), $user->user_login ), $msg );

    	return true;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/ms-functions.php#L1529)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/ms-functions.php#L1529-L1572)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#hooks)󠁿

 [apply_filters( ‘newuser_notify_siteadmin’, string $msg, WP_User $user )](https://developer.wordpress.org/reference/hooks/newuser_notify_siteadmin/)

Filters the message body of the new user activation email sent to the network administrator.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#related)󠁿

| Uses | Description | 
| [is_email()](https://developer.wordpress.org/reference/functions/is_email/)`wp-includes/formatting.php` |

Verifies that an email is valid.

  | 
| [wp_mail()](https://developer.wordpress.org/reference/functions/wp_mail/)`wp-includes/pluggable.php` |

Sends an email, similar to PHP’s mail function.

  | 
| [network_admin_url()](https://developer.wordpress.org/reference/functions/network_admin_url/)`wp-includes/link-template.php` |

Retrieves the URL to the admin area for the network.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [wp_unslash()](https://developer.wordpress.org/reference/functions/wp_unslash/)`wp-includes/formatting.php` |

Removes slashes from a string or recursively removes slashes from strings within an array.

  | 
| [esc_url()](https://developer.wordpress.org/reference/functions/esc_url/)`wp-includes/formatting.php` |

Checks and cleans a URL.

  | 
| [get_userdata()](https://developer.wordpress.org/reference/functions/get_userdata/)`wp-includes/pluggable.php` |

Retrieves user info by user ID.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  | 
| [get_site_option()](https://developer.wordpress.org/reference/functions/get_site_option/)`wp-includes/option.php` |

Retrieve an option value for the current network based on name of option.

  |

[Show 6 more](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/newuser_notify_siteadmin/?output_format=md#changelog)󠁿

| Version | Description | 
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fnewuser_notify_siteadmin%2F)
before being able to contribute a note or feedback.