Public Ticket #3666487

add email recipient

Closed
Comments
13 Tickets 4
John Higgins started the conversation 2 years ago on June 13, 2024 at 7:37pm

How can I add a recipient to a system email that currently only goes to the customer.  The system email is for "account Approved".  I need to able to cc in my bookkeeper on this to set them up in Quickbooks.

2,762
KingsPlugins replied 2 years ago on June 14, 2024 at 12:55am

Hi John,

I understand you're looking at the "account approved" email, sent to the customer when their account registration is approved.

You can add a CC to that email, by adding this PHP code snippet to your site:

add_filter('woocommerce_email_headers', 'add_cc_to_b2bking_approved_email', 10, 3);
function add_cc_to_b2bking_approved_email($headers, $email_id, $order) {
    if ($email_id === 'b2bking_your_account_approved_email') {
        $cc_email = '[email protected]';
        $headers .= 'Cc: ' . $cc_email . "\r\n";
    }
    return $headers;
}

In this code, replace [email protected] with the address of your bookkeeper.

This code snippet can be added to functions.php, or by following our guide here: https://b2bkingplugin.com/docs/how-to-add-a-snippet-php-or-js/

Kind regards,

Stefan

Sign In