1
votes

Our Woocommerce shop has prices disabled and we have to manually approve accounts before they can see product prices. When customers register using the WooCommerce registration page they can be sent a email using the "new account" option in the settings > emails which is great but we would like to know when a customer has registered so we can approve the account.

How can the site admin get a copy of this email as a BCC ? or be alerted when the customer has registered.

We have been using a notification plugin in the past but this has now stopped working due to changes to the WC core.

Any help is appreciated.

1

1 Answers

0
votes

To add the Wordpress admin email as BCC recipient for New account notification:

add_filter( 'woocommerce_email_headers', 'customer_new_account_admin_notification', 20, 3 );
function customer_new_account_admin_notification( $header, $email_id, $order ) {
    // Only for "Customer new account" notification
    if( 'customer_new_account' == $email_id ) {
        // Get admin email
        $admin_email = get_option('admin_email');

        // Set the email as BCC
        $header .= 'Bcc: ' . $admin_email . "\r\n";
    }
    return $header;
}

Code goes in function.php file of your active child theme (or active theme). Tested and work.