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
-
(Required) Text in the email.
- $new_admin_email
-
(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.
- 'hash'
Source
File: bp-core/bp-core-wp-emails.php
1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 | 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
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.