This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Add BCC to WooCommerce emails (with YITH) | |
Plugin URI: https://www.damiencarbery.com/2020/03/add-bcc-to-woocommerce-emails/ | |
Description: Add an email address as BCC to all WooCommerce emails. Updated for when YITH Request a Quote installed. | |
Author: Damien Carbery | |
Author URI: https://www.damiencarbery.com | |
Version: 0.1 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add another email recipient for admin New Order emails if a shippable product is ordered for a specific city | |
* | |
* @param string $recipient a comma-separated string of email recipients (will turn into an array after this filter!) | |
* @param \WC_Order $order the order object for which the email is sent | |
* @return string $recipient the updated list of email recipients | |
*/ | |
function mr_wc_conditional_email_recipient( $recipient, $order ) { | |
// Bail on WC settings pages since the order object isn't yet set yet | |
// Not sure why this is even a thing, but shikata ga nai |
OlderNewer