• Resolved Martin Sauter

    (@martinsauter)


    When you let Advanced Classifieds & Directory Pro handle the user registration process, the chosen password is sent in plain text to the new user by email.

    I don’t think this is best practice, and we have users complaining about this. Is there a way to deactivate this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author pluginsware

    (@pluginsware)

    Hi,
    ? ?
    You can use the “acadp_new_user_notification_email_body” filter hook to strip down the?password?from the new user emails. Kindly refer to the function named “acadp_new_user_notification” in /wp-content/plugins//advanced-classifieds-and-directory-pro/includes/functions-acadp-email.php?file for more details on this.?

    Thanks

    Thread Starter Martin Sauter

    (@martinsauter)

    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
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to prevent this plugin from sending passwords?’ is closed to new replies.