bp_email_wp_new_admin_email_content( string $email_text, array $new_admin_email )

Filters the text of the email sent when a change of site admin email address is attempted.

Description

The following strings have a special meaning and will get replaced dynamically:

USERNAME### The current user’s username.

ADMIN_URL### The link to click on to confirm the email change.

EMAIL### The proposed new site admin email address.

SITENAME### The name of the site.

SITEURL### The URL to the site.

Parameters

$email_text

(string) (Required) Text in the email.

$new_admin_email

(array) (Required) Data relating to the new site admin email address.

  • 'hash'
    (string) The secure hash used in the confirmation link URL.
  • 'newemail'
    (string) The proposed new site admin email address.

Source

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

	function bp_email_wp_new_admin_email_content( $email_text, $new_admin_email ) {

		$admin_email = get_option( 'admin_email' );

		if ( ! is_email( $admin_email ) ) {
			return $email_text;
		}

		/* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */
		$email_text = '<p>' . __( 'Howdy ###USERNAME###,', 'buddyboss' ) . '</p>';
		$email_text .= '<p>' . __( 'You recently requested to have the administration email address on your site changed.', 'buddyboss' ) . '</p>';
		$email_text .= '<p>' . __( 'If this is correct, please <a href="###ADMIN_URL###">click here</a> to change it.', 'buddyboss' ) . '</p>';
		$email_text .= '<p>' . __( 'You can safely ignore and delete this email if you do not want to take this action.', 'buddyboss' ) . '</p>';
		$email_text .= '<p>' . __( 'This email has been sent to ###EMAIL###', 'buddyboss' ) . '</p>';
		$email_text .= '<p>' . __( 'Regards, <br />All at ###SITENAME### <br />###SITEURL###', 'buddyboss' ) . '</p>';

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

		$email_text = bp_email_core_wp_get_template( $email_text, get_user_by( 'email', $admin_email ) );

		return $email_text;
	}

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.