Send order notifications to the billing address emails in WooCommerce

Send order notifications to the billing address emails in WooCommerce on child sites.

Snippet Type

Execute on Child Sites

Snippet

function custom_woocommerce_email_recipient( $recipient, $object, $email ) {
    // Only target "new order" email notifications
    if ( $email->id === 'new_order' ) {
        // Get the user's billing email address
        $billing_email = $object->get_billing_email();
        // Get the user's customer profile email address
        $profile_email = $object->get_user()->user_email;
        // Add the customer profile email address to the recipient list
        $recipient .= ',' . $profile_email;
    }
    return $recipient;
}
add_filter( 'woocommerce_email_recipient', 'custom_woocommerce_email_recipient', 10, 3 );

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.