Wordpress - How to trigger WooCommerce order complete email?
You can try this
$mailer = WC()->mailer();
$mails = $mailer->get_emails();
if ( ! empty( $mails ) ) {
foreach ( $mails as $mail ) {
if ( $mail->id == 'customer_completed_order' ) {
$mail->trigger( $order->id );
}
}
}
Rather than looping or reusing the same object as suggested by @Sumit. You can initiate a new object and then call the trigger.
$email_oc = new WC_Email_Customer_Completed_Order();
$email_oc->trigger($order_id);