Skip to content

Instantly share code, notes, and snippets.

@KoolPal
KoolPal / wc-add-bcc-to-emails-with-yith.php
Created June 13, 2020 06:15 — forked from damiencarbery/wc-add-bcc-to-emails-with-yith.php
Add BCC to WooCommerce emails - Add an email address (or two) as BCC to all WooCommerce emails. https://www.damiencarbery.com/2020/03/add-bcc-to-woocommerce-emails/
<?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
*/
@KoolPal
KoolPal / mr_wc_new_order_email_recipient.php
Created March 6, 2023 04:43 — forked from monecchi/mr_wc_new_order_email_recipient.php
WooCommerce New Order Email to different recipient based on customer's city
/**
* 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