Thanks, this works fine.
For anyone with the same question, here is the code:
function new_users_custom_message ( $message, $user_id, $plaintext_pass ) {
$user = get_userdata( $user_id );
$blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
$length = strlen($plaintext_pass);
$masked_password = str_repeat('*', $length);
$subject = sprintf( __( '[%s] Your username and password info', 'advanced-classifieds-and-directory-pro' ), $blog_name );
$message = __( 'Hi there,', 'advanced-classifieds-and-directory-pro' ) . "<br /><br />";
$message .= sprintf( __( "Welcome to %s! Here's how to log in:", 'advanced-classifieds-and-directory-pro' ), $blog_name ) . "<br /><br />";
$message .= acadp_get_user_login_page_link() . "<br />";
$message .= sprintf( __( 'Username: %s', 'advanced-classifieds-and-directory-pro' ), $user->user_login ) . "<br />";
$message .= sprintf( __( 'Password: %s', 'advanced-classifieds-and-directory-pro' ), $masked_password ) . "<br /><br />";
$message .= __( 'Thanks!', 'advanced-classifieds-and-directory-pro' );
return $message;
}
add_filter( 'acadp_new_user_notification_email_body', 'new_users_custom_message', 10, 3 );
-
This reply was modified 1 year, 8 months ago by
Martin Sauter. Reason: formatting of code snippet