title: Get order meta data on WooCommerce email when order Id is not available
body: <p>I am trying to extract order meta data of a custom field that I added to my WooCommerce checkout form. I am doing this in a PHP file that is used to add a custom section to the order confirmation email sent to the customer by WooCommerce (i.e. the very last stage of order processing).</p>
  
  <p>In order to do this, I am trying to use WC_Order class with following code:</p>
  
  <p><code>$my_var = get_post_meta( $order_id, 'custom_field_meta_key', true );</code></p>
  
  <p>However, this approach doesn't work. I realised that the "order_id" variable is not available in the PHP page. I used the following code to confirm this:</p>
  
  <p><code>print_r(array_keys(get_defined_vars()));</code></p>
  
  <p>Below is the output that I get:</p>
  
  <p><code>Array ( [0] =&gt; template_name [1] =&gt; args [2] =&gt; template_path [3] =&gt; default_path [4] =&gt; cache_key [5] =&gt; template [6] =&gt; filter_template [7] =&gt; action_args [8] =&gt; title [9] =&gt; delivery_date [10] =&gt; email )</code></p>
  
  <p>Can somebody please help me with the best way to get the expected outcome?</p>