bp_email_wp_new_user_email_content( string $email_text, array $new_user_email )

Filters the text of the email sent when a change of user 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 new email.

SITENAME### The name of the site.

SITEURL### The URL to the site.

Parameters

$email_text

(string) (Required) Text in the email.

$new_user_email

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

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

Source

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

	function bp_email_wp_new_user_email_content( $email_text, $new_user_email ) {

		$current_user = wp_get_current_user();

		if ( empty( $current_user->ID ) ) {
			return $email_text;
		}

		/* translators: Do not translate USERNAME, ADMIN_EMAIL, EMAIL, SITENAME, SITEURL: those are placeholders. */
		$email_text = '<p>' . __( 'Howdy ###USERNAME###,', 'buddyboss' ) . '</p>';
		$email_text .= '<p>' . __( 'You recently requested to have the email address on your account 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, $current_user );

		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.