• Resolved rohanbhatia

    (@rohanbhatia)


    Hi,
    I want to bcc the review mail to the admin.

    What is name of your review mail template?

    I want to add the following code to my theme’s function.php

    function add_bcc_to_certain_emails( $headers, $object ) {
    	$add_bcc_to = array(
    	'your_email_template_name',
            'customer_processing_order',
    	);
    	
        // if our email object is in our array
    	if ( in_array( $object, $add_bcc_to ) ) {
    		// change our headers
    		$headers = array( 
    			$headers,
    			'Bcc: Admin <[email protected]>' ."\r\n",
    			);
    	}
    	return $headers;
    }
    add_filter( 'woocommerce_email_headers', 'add_bcc_to_certain_emails', 10, 2 );

    Please tell me what your template name so I can add this code successfully.

    • This topic was modified 5 years, 3 months ago by rohanbhatia.
Viewing 1 replies (of 1 total)
  • Hi,
    Our plugin does not use a template like that so you can not use this to modify email headers.
    BTW, your function will not work at all because filter ‘woocommerce_email_headers’ returns string not array.
    Regards

Viewing 1 replies (of 1 total)
  • The topic ‘Need to BCC the review mail to the admin’ is closed to new replies.