title: How to check WooCommerce order meta before sending email notification
body: <p>I'm trying to add custom meta to my new order emails. At this moment, custom meta shows up when I use the &quot;Resend new order notification&quot;, but it doesn't when a purchase is made through the website.</p>
  <p>I suspect this has to do with my code not being able to check the Order Details before sending the email notification. Here's the code I came up with so far..</p>
  <pre><code>// Ref: https://www.businessbloomer.com/woocommerce-add-extra-content-order-email/
  
  function custom_order_type_number_email( $order, $sent_to_admin, $plain_text, $email ) {
      
      // Get custom Order Type and Order Number meta keys
      $custom_order_type = get_post_meta( $order-&gt;get_id(), 'custom_order_type', true );
      $custom_order_number = get_post_meta( $order-&gt;get_id(), 'custom_order_number', true );
      
      // Add for New Order email notification only
      if ( $email-&gt;id == 'new_order' ) {
          if ( !empty( $custom_order_type ) ) {
              echo '&lt;p&gt;&lt;b&gt;Order type :&lt;/b&gt; ' . $custom_order_type . '&lt;/p&gt;';
          } else {
              echo '&lt;p&gt;&lt;b&gt;Order type :&lt;/b&gt; Website&lt;/p&gt;';
          }
          
          if ( !empty( $custom_order_number ) ) {
              echo '&lt;p&gt;&lt;b&gt;Order no :&lt;/b&gt; ' . $custom_order_number . '&lt;/p&gt;';
          } else {
              echo '&lt;p&gt;&lt;b&gt;Order no :&lt;/b&gt; New&lt;/p&gt;';
          }
      }
  }
  add_action( 'woocommerce_email_after_order_table', 'custom_order_type_number_email', 20, 4 );
  </code></pre>
  <p>What I'm trying to do ideally is..</p>
  <p>When the customer purchases from the website, this new order will be without the custom meta. So the custom meta in the email will show Order type: Website / Order number: New.</p>
  <p>And if the admin manually adds a new order with defined custom meta, this new order email notification would get and show the saved custom meta later.</p>
  <p>I hope this made sense. (&gt;_&lt;) And thanks in advance for the help.</p>