Hi,
I have updated the status of the order in this way:
$order = wc_get_order($orderId);
if ($order) {
$order->update_status($newOrderStatus, '(by cron)');
}
or
$order = new WC_Order($orderId);
if ($order) {
$order->update_status($newOrderStatus, '(by cron)');
}
This code has updated the status but email does not sends.
Please advise.