WooCommerce

How to Add BCC Recipients to WooCommerce Emails?

· 3 min read

Are you looking to expand the reach of your WooCommerce emails or quietly keep certain parties in the loop? You’re in the right place! I will show you how to add BCC (Blind Carbon Copy) recipients to specific WooCommerce emails, giving you more control over your store’s communication.

Why Add BCC Recipients to WooCommerce Emails?

There are several reasons you might want to BCC additional recipients on your WooCommerce emails:

  1. Keeping team members informed about order statuses

  2. Notifying vendors about relevant transactions

  3. Creating a record of sent emails for customer service purposes

  4. Monitoring specific types of orders or customers

While WooCommerce’s default settings don’t offer this feature, we can easily add it with a bit of code.

The Solution: Using the woocommerce_email_headers Filter

WooCommerce provides a handy filter called woocommerce_email_headers that allows us to modify email headers. We’ll use this to add our BCC recipients.

Step-by-Step Guide to Adding BCC Recipients

Follow these steps to add BCC recipients to your WooCommerce emails:

  1. Open your child theme’s functions.php file or create a new snippet in the Code Snippets plugin.

  2. Copy and paste the following code:

/**
 * Add BCC to certain WooCommerce emails.
 *
 * @param string $headers
 * @param string $email_id
 * @return string
 */
function wcwiz_add_bcc_to_specific_emails( $headers, $email_id ) {
    $bcc_these_emails = array(
        'customer_completed_order', // Add other email IDs here
    );
    
    if ( in_array( $email_id, $bcc_these_emails ) ) {
        $headers = array(
            $headers,
            'Bcc: Your Name <your@email.com>' . "\r\n", // Modify this email
        );
    }
    
    return $headers;
}
add_filter( 'woocommerce_email_headers', 'wcwiz_add_bcc_to_specific_emails', 10, 2 );
  1. Customize the code:
  1. Save the file or activate the snippet.

Explanation of the Code

Let’s break down what this code does:

Customizing for Your Needs

You can easily modify this code to suit your specific requirements:

Conclusion

Adding BCC recipients to your WooCommerce emails is a powerful way to enhance your store’s communication workflow. With this simple code snippet, you can keep team members informed, notify vendors, or create a record of important emails.

Remember, always test your changes in a staging environment before applying them to your live site. And be mindful of privacy concerns when BCCing emails – ensure you have the necessary permissions and comply with relevant data protection regulations.

Have you tried adding BCC recipients to your WooCommerce emails? Share your experiences or questions in the comments below!

Shameem Reza
Written by Shameem Reza

I am a Happiness Engineer at Automattic, helping merchants turn WooCommerce chaos into calm with clear solutions and simple technical breakdowns.

Enjoyed reading this?

This site stays ad-free and independent. If something here saved you time or taught you something new, a coffee goes a long way.

Buy me a coffee ☕
Keep reading