I am using the My Login Theme WordPress Plugin. My goal is to filter out 'retrieve_password_message' - just make minor textual changes to the email that is sent when the user asks for the reset password.
My code is:
function filter_reset_password_request_email_body( $message, $key, $user_id ) {
$user_login = bp_core_get_username( $user_id );
$message .= sprintf( __( 'Password reset request for %s' ), $user_login ) . "\r\n\r\n";
$message .= __( 'If this was not you, please ignore this email and nothing will happen.' ) . "\r\n\r\n";
$message .= __( 'To reset your password, visit the following link:' ) . "\r\n\r\n";
$message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' ) . "\r\n";
return $message;
}
add_filter( 'retrieve_password_message', 'filter_reset_password_request_email_body', 10, 3 );
The problem is that when using this filter, the sent email displays the filtered message directly below the original (unfiltered) message. I just need a filtered message to display in the body of the message.
Am I doing something wrong or could it be a mistake with Theme My Login?
Hoping someone can shed some light on this.
: BuddyPress, bp_core_get_username .