在woocommerce电子邮件中调用自定义订单元

I have custom fields in the checkout in woocommerce and I want these fields to appear in the email template.

I am adding the following but it still not showing:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post();

            $mycustom = get_post_meta( $order->id, 'wccf_delivery_day', true );
            echo $mycustom;?>
            <?php endwhile; ?>

You can make use of woocommerce_email_order_meta_keys filter hook

add_filter('woocommerce_email_order_meta_keys', 'my_woocommerce_email_order_meta_keys');

function my_woocommerce_email_order_meta_keys( $keys ) {

    $keys['Delivery Day'] = '_wccf_delivery_day';

    return $keys;

} 

If you need more control over the display try using woocommerce_email_after_order_table action hook

add_action( "woocommerce_email_after_order_table", "custom_woocommerce_email_after_order_table", 10, 1);

function custom_woocommerce_email_after_order_table( $order ) {

    echo '<p><strong>Delivery Day :</strong>'. get_post_meta( $order->id, "_wccf_delivery_day", true ) .'</p>';

}