Home Forums General Issues Displaying values in woocommerce emails Reply To: Displaying values in woocommerce emails

  • I can’t recall ever seeing a topic on trying to put acf values into emails, so this is just a guess. You probably need to include the post ID of where to get the value from, for example the post ID of the order post, and I don’t know if that information is available where you are generating the email. Does WC pass the order/post ID to the mail function?

    $tracking 	= get_field('tracking-code', $post_id);
    $carrier 	= get_field('carrier-name', $post_id);
    $date 		= get_field('pickup_date', $post_id);
    <p>Your order has been picked up by <?php echo $carrier; ?> on <?php echo $date; ?>. Your tracking code is <?php echo $tracking; ?>.</p>