I am trying to display a custom field value to my Woocommerce email template that was created as part of a product import.
This custom field is called 'Reference number'.
How do I do this?
Edit:
This works:
<td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
<?php echo wp_kses_post( $sku ); ?>
</td>
This doesn't:
<td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
<?php echo $product->get_meta( 'Reference number' );
?>
</td>
The meta_key has been taken from the DB