• We use the plugin in the website at my job, but it seems that the a side effect occurred since version 1.3.2.

    We use the plugin to style our emails + for the functionality described below.

    Our website has a custom PHP functionality, used in combination with WooCommerce to send an email to admin when a new customer register on our website.

    Since 1.3.2, we do not receive this email.
    I have downgraded at 1.3.1.2, and the problem disappeared.

    See the code sample below.

    
    <?php
    
    add_filter( 'wp_new_user_notification_email_admin', 'custom_admin_new_account_email', 50, 3 );
    function custom_admin_new_account_email( $wp_new_user_notification_email_admin, $user, $blogname ) {
    
        // blogname option is escaped with esc_html on the way into the database in sanitize_option
        // reverse this for the plain text area of emails.
        $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    
        $user = new WC_Customer( $user->ID );
    
        // Building message body... $message
    
        $wp_new_user_notification_email_admin = array(
            'to' => get_option( 'admin_email' ),
            'subject' => sprintf( 'New Customer Registered on %s', $blogname ),
            'message' => $message,
            'headers' => array('Content-Type: text/html; charset=UTF-8'),
        );
    
        return $wp_new_user_notification_email_admin;
    
    }
    
    add_action( 'woocommerce_created_customer', 'new_account_admin_notification', 20 );
    function new_account_admin_notification( $customer_id ) {
        wp_send_new_user_notifications( $customer_id, 'admin' );
    }
    
    ?>
    
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Issue version 1.3.2 – Admin new user emails not sent’ is closed to new replies.