• Hello! We have a custom plugin which receives a CSV file on a nightly basis containing order ID’s and the tracking number of a package sent by Fedex. The plugin reads in the order ID’s and updates the FedEx tracking number for the package and changes the order status to completed.

    The tracking number update and order completion status change work fine, but we found the completion notification emails are not going out to the customer when updated via this plugin’s scripting. When we manually go in to the order and change it from processing to completed, the email notification sends just fine.

    How can we get our plugin’s code to trigger the standard “completed” notification to go to the customer?

    See below for the relevant section of code:

    $order = wc_get_order( $split[2] );
       if ( 'completed' != $order->status) {
    	require_once('newclass.php');	
    	$OurNewClass = new OurNewClass; 
    	$args = array(
    		'tracking_provider'        => 'fedex',
    		'custom_tracking_provider' => '',
    		'custom_tracking_link'     => '',
    		'tracking_number'          => $split[3],
    		'date_shipped'             => ''
    	);
    	$OurNewClass->add_tracking_item( $split[2], $args );
    
    	$order->update_status( 'completed' );
    }
    • This topic was modified 8 years, 5 months ago by pcdrgf.
  • The topic ‘Order Completion Email Notification Trigger Not Working’ is closed to new replies.