bp_email_wp_password_change_email( array $pass_change_email, array $user, array $userdata )
Filters the contents of the email sent when the user’s password is changed.
Description
Parameters
- $pass_change_email
-
(Required) Used to build wp_mail().
- 'to'
(string) The intended recipients. Add emails in a comma separated string. - '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: - ###USERNAME### The current user's username. - ###ADMIN_EMAIL### The admin email in case this was unexpected. - ###EMAIL### The user's email address. - ###SITENAME### The name of the site. - ###SITEURL### The URL to the site. - 'headers'
(string) Headers. Add headers in a newline (rn) separated string.
- 'to'
- $user
-
(Required) The original user array.
- $userdata
-
(Required) The updated user array.
Return
(array) $pass_change_email Password Change Email data.
Source
File: bp-core/bp-core-wp-emails.php
function bp_email_wp_password_change_email( $pass_change_email, $user, $userdata ) {
/* translators: Do not translate USERNAME, ADMIN_EMAIL, EMAIL, SITENAME, SITEURL: those are placeholders. */
$pass_change_text = '<p>' . __( 'Hi ###USERNAME###,', 'buddyboss' ) . '</p>';
$pass_change_text .= '<p>' . __( 'This notice confirms that your password was changed on ###SITENAME###.', 'buddyboss' ) . '</p>';
$pass_change_text .= '<p>' . __( 'If you did not change your password, please contact the Site Administrator at <br />###ADMIN_EMAIL###', 'buddyboss' ) . '</p>';
$pass_change_text .= '<p>' . __( 'This email has been sent to ###EMAIL###', 'buddyboss' ) . '</p>';
$pass_change_text .= '<p>' . __( 'Regards, <br />All at ###SITENAME### <br />###SITEURL###', 'buddyboss' ) . '</p>';
$pass_change_email = array(
'to' => $user['user_email'],
/* translators: User password change notification email subject. 1: Site name */
'subject' => __( '[%s] Notice of Password Change', 'buddyboss' ),
'message' => $pass_change_text,
'headers' => '',
);
add_filter( 'wp_mail_content_type', 'bp_email_set_content_type' ); //add this to support html in email
$pass_change_email = bp_email_core_wp_get_template( $pass_change_email, $user );
return $pass_change_email;
}
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.