Forked from ddemuth/woocommerce-custom-email-recipient.php
Created
January 30, 2021 21:42
-
-
Save gsdefender/e671d9fcffeda3b0fbef87e25890a31d to your computer and use it in GitHub Desktop.
Customize the email recipient
This file contains 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
//WooCommerce Email Customizations | |
add_filter( 'woocommerce_email_recipient_customer_note', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2); | |
add_filter( 'woocommerce_email_recipient_customer_completed_order', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2); | |
add_filter( 'woocommerce_email_recipient_customer_invoice', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2); | |
add_filter( 'woocommerce_email_recipient_customer_processing_order', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2); | |
/** | |
* $recipient could be comma separated to send to additional people | |
* EX. $recipient .= ', $additonal_recipient'; | |
*/ | |
function fka_parent_email_recipient_filter_function($recipient, $order) { | |
$parent_email_recipient = get_post_meta( $order->id, 'Parent Email', true ); | |
$recipient = $parent_email_recipient; | |
return $recipient; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment