79652711

Date: 2025-06-04 12:05:09
Score: 2.5
Natty:
Report link

I`m getting a fatal error..
any idea why?

add_filter('woocommerce_email_recipient_customer_processing_order', 'email_recipient_custom_notification', 10, 2);
function email_recipient_custom_notification( $recipient, $order ) {
    
    if ( ! is_a( $order, 'WC_Order' ) ) return $recipient;
    
    // Set HERE your replacement recipient email(s)… (If multiple, separate them by a coma)
    $recipient .= ', [email protected]';
    return $recipient;
}

add_action('woocommerce_order_status_changed', 'send_custom_email_notifications', 10, 4 );

function send_custom_email_notifications( $order_id, $old_status, $new_status, $order ){
    
    $wc_emails = WC()->mailer()->get_emails(); // Get all WC_emails objects instances
    
    if ($new_status === 'ticket-ontime') {

        $wc_emails['WC_Email_Customer_Processing_Order']->trigger( $order_id );
    }
   
}
Reasons:
  • Blacklisted phrase (0.5): why?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: TIKAIR2000