| 139 | | wp_mail( |
| 140 | | get_site_option( 'admin_email' ), |
| 141 | | sprintf( |
| 142 | | /* translators: %s: network name */ |
| 143 | | __( '[%s] New Site Created' ), |
| 144 | | get_network()->site_name |
| 145 | | ), |
| 146 | | sprintf( |
| 147 | | /* translators: 1: user login, 2: site url, 3: site name/title */ |
| 148 | | __( 'New site created by %1$s |
| | 139 | /* translators: %s: network name */ |
| | 140 | $new_site_subject = sprintf( __( '[%s] New Site Created' ), get_network()->site_name ); |
| 152 | | $current_user->user_login, |
| 153 | | get_site_url( $id ), |
| 154 | | wp_unslash( $title ) |
| 155 | | ), |
| 156 | | sprintf( |
| 157 | | 'From: "%1$s" <%2$s>', |
| 158 | | _x( 'Site Admin', 'email "From" field' ), |
| 159 | | get_site_option( 'admin_email' ) |
| 160 | | ) |
| | 147 | $current_user->user_login, |
| | 148 | get_site_url( $id ), |
| | 149 | wp_unslash( $title ) |
| | 150 | ); |
| | 151 | |
| | 152 | $headers = sprintf( |
| | 153 | 'From: "%1$s" <%2$s>', |
| | 154 | _x( 'Site Admin', 'email "From" field' ), |
| | 155 | get_site_option( 'admin_email' ) |
| | 156 | ); |
| | 157 | |
| | 158 | $new_site_created_email = array( |
| | 159 | 'admin_email' => get_site_option( 'admin_email' ), |
| | 160 | 'subject' => $new_site_subject, |
| | 161 | 'message' => $new_site_message, |
| | 162 | 'headers' => $headers |
| | 163 | ); |
| | 164 | |
| | 165 | /** |
| | 166 | * Filters the contents of the email sent when a new site is created. |
| | 167 | * |
| | 168 | * @since 4.9 |
| | 169 | * |
| | 170 | * @param array $new_site_created_email { |
| | 171 | * Used to build wp_mail(). |
| | 172 | * @type string $admin_email Email of the newly created site user. |
| | 173 | * @type string $subject The subject of the email. |
| | 174 | * @type string $message The content of the email. |
| | 175 | * The following strings have a special meaning and will get replaced dynamically: |
| | 176 | * - ###SITENAME### The name of the site. |
| | 177 | * - ###SITEURL### The URL to the site. |
| | 178 | * @type string $headers Headers. Add headers in a newline (\r\n) separated string. |
| | 179 | * } |
| | 180 | * @param int $user_id ID of the newly created user. |
| | 181 | * |
| | 182 | */ |
| | 183 | |
| | 184 | $new_site_created_email = apply_filters( 'new_site_created', $new_site_created_email, $user_id ); |
| | 185 | |
| | 186 | $new_site_created_email['message'] = str_replace( '###SITENAME###', wp_unslash( $title ), $new_site_created_email['message'] ); |
| | 187 | $new_site_created_email['message'] = str_replace( '###SITEURL###', get_site_url( $id ), $new_site_created_email['message'] ); |
| | 188 | |
| | 189 | wp_mail( |
| | 190 | $new_site_created_email['admin_email'], |
| | 191 | $new_site_created_email['subject'], |
| | 192 | $new_site_created_email['message'], |
| | 193 | $new_site_created_email['headers'] |