add_action ('woocommerce_email_customer_details', 'custom_email_customer_details', 15, 4);
function custom_email_customer_details( $order, $sent_to_admin, $plain_text, $email ){
// Only for "New Order" email notification
if ( 'new_order' != $email->id ) return;
// Only "Flat Rate" Shipping Method
if ( $order->has_shipping_method('flat_rate') ){
$order_id = $order->get_id(); // The Order ID
// Test output
echo "<p>Message: The Order ID is $order_id</p>";
echo '<p>Custom field: '. get_post_meta( $order_id, '_recorded_sales', true ) .'</p>';
}
}