title: Target specific WooCommerce email notifications when using the "woocommerce_order_item_meta_start" hook
body: <p>I have this function which adds custom meta field to the product detail in all WooCommerce emails. But I need to show only after the order is paid (this can be also just the &quot;completed&quot; email).</p>
  <pre class="lang-php prettyprint-override"><code>add_action( 'woocommerce_order_item_meta_start', 'email_confirmation_display_order_items', 10, 3 );
  function email_confirmation_display_order_items( $item_id, $item, $order ) {
      // On email notifications for line items
      if ( ! is_wc_endpoint_url() &amp;&amp; $item-&gt;is_type('line_item') ) {
          $ot_address = get_post_meta( $item-&gt;get_product_id(), 'ot_address', true );
  
          if ( ! empty($ot_address) ) {
              printf( '&lt;div&gt;' . __(&quot;Terms: %s&quot;, &quot;woocommerce&quot;) . '&lt;/div&gt;', $ot_address );
          }
      }
  }
  </code></pre>
  <hr />
  <p>I hoped that I can nest it inside <code>if ( $email-&gt;id == 'customer_completed_order' ) {}</code>, so the final code will look like this:</p>
  <pre class="lang-php prettyprint-override"><code>add_action( 'woocommerce_order_item_meta_start', 'email_confirmation_display_order_items', 10, 3 );
  function email_confirmation_display_order_items( $item_id, $item, $order ) {
      if ( $email-&gt;id == 'customer_completed_order' ) {
          // On email notifications for line items
          if ( ! is_wc_endpoint_url() &amp;&amp; $item-&gt;is_type('line_item') ) {
              $ot_address = get_post_meta( $item-&gt;get_product_id(), 'ot_address', true );
  
              if ( ! empty($ot_address) ) {
                  printf( '&lt;div&gt;' . __(&quot;Terms: %s&quot;, &quot;woocommerce&quot;) . '&lt;/div&gt;', $ot_address );
              }
          }
      }
  }
  </code></pre>
  <p>But it stops working after that change. Any advice?</p>