1

With WooCommerce Subscriptions, the email notifications confirming a subscription's suspension, expiration, or cancellation are sent only to store admin. I would like to cc: the customer on these notifications.

I believe I've found the right hooks, but the custom function I found that's supposed to cc: the customer for order cancellations in regular WooCommerce (not Subscriptions) is not working. I am pretty new to both PHP and WooCommerce.

Here's the code I have now:

/** CC customer on subscription change emails */
add_filter( 'on-hold_subscription_notification', 'custom_woocommerce_cc_customer_email', 10, 2 );
add_filter( 'expired_subscription_notification', 'custom_woocommerce_cc_customer_email', 10, 2 );
add_filter( 'cancelled_subscription_notification', 'custom_woocommerce_cc_customer_email', 10, 2 );

function custom_woocommerce_cc_customer_email( $recipient, $order ){
     return $recipient . ',' . $order->get_billing_email();
 }

Without this code, things work as expected (the admin email is notified of a subscription suspension, expiration, or cancellation but the customer is not).

With this code, neither the admin nor the customer is notified.

Again I'm looking for a solution to notify both the admin email AND the customer.

user2930880
  • 91
  • 1
  • 6

0 Answers0