bp_email_network_admin_email_change_email( array $email_change_email, string $old_email, string $new_email, int $network_id )

Filters the contents of the email notification sent when the network admin email address is changed.

Description

Parameters

$email_change_email

(array) (Required) Used to build wp_mail().

  • 'to'
    (string) The intended recipient.
  • 'subject'
    (string) The subject of the email.
  • 'message'
    (string) The content of the email. The following strings have a special meaning and will get replaced dynamically: - ###OLD_EMAIL### The old network admin email address. - ###NEW_EMAIL### The new network admin email address. - ###SITENAME### The name of the network. - ###SITEURL### The URL to the site.
  • 'headers'
    (string) Headers.

$old_email

(string) (Required) The old network admin email address.

$new_email

(string) (Required) The new network admin email address.

$network_id

(int) (Required) ID of the network.

Source

File: bp-core/bp-core-wp-emails.php

	function bp_email_network_admin_email_change_email( $email_change_email, $old_email, $new_email, $network_id ) {

		/* translators: Do not translate OLD_EMAIL, NEW_EMAIL, SITENAME, SITEURL: those are placeholders. */
		$email_change_text = '<p>' . __( 'Hi,', 'buddyboss' ) . '</p>';
		$email_change_text .= '<p>' . __( 'This notice confirms that the network admin email address was changed on ###SITENAME###.', 'buddyboss' ) . '</p>';
		$email_change_text .= '<p>' . __( 'The new network admin email address is ###NEW_EMAIL###.', 'buddyboss' ) . '</p>';
		$email_change_text .= '<p>' . __( 'This email has been sent to ###OLD_EMAIL###', 'buddyboss' ) . '</p>';
		$email_change_text .= '<p>' . __( 'Regards, <br /> All at ###SITENAME### <br /> ###SITEURL###', 'buddyboss' ) . '</p>';

		$email_change_email = array(
			'to'      => $old_email,
			/* translators: Network admin email change notification email subject. %s: Network title */
			'subject' => __( '[%s] Notice of Network Admin Email Change', 'buddyboss' ),
			'message' => $email_change_text,
			'headers' => '',
		);

		add_filter( 'wp_mail_content_type', 'bp_email_set_content_type' ); //add this to support html in email

		$email_change_email = bp_email_core_wp_get_template( $email_change_email, get_user_by( 'email', $new_email ) );

		return $email_change_email;
	}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.