bp_email_site_admin_email_change_email( array $email_change_email, string $old_email, string $new_email )

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

Description

Parameters

$email_change_email

(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 site admin email address. - ###NEW_EMAIL### The new site admin email address. - ###SITENAME### The name of the site. - ###SITEURL### The URL to the site.
  • 'headers'
    (string) Headers.

$old_email

(Required) The old site admin email address.

$new_email

(Required) The new site admin email address.

Source

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

	function bp_email_site_admin_email_change_email( $email_change_email, $old_email, $new_email ) {

		/* 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 admin email address was changed on ###SITENAME###.', 'buddyboss' ) . '</p>';
		$email_change_text .= '<p>' . __( 'The new 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: Site admin email change notification email subject. %s: Site title */
			'subject' => __( '[%s] Notice of 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.