In the past, I placed the following code snippet in function.php to speed up the checkout process in WooCommerce:
add_filter( 'woocommerce_defer_transactional_emails', '__return_true' );
However, recently I have not been receiving emails when there are new orders. After removing the above code snippet, everything works fine, but it slows down the checkout process by 20-30 seconds. Upon investigation, I found the error here: Uncaught Error: Call to a member function format() on null in /woocommerce/emails/email-order-details.php:34
$order->get_date_created()->format( 'c' )
Is there a way to delay email processing to speed up the checkout process without causing this error? Or how can I fix the error mentioned above?