I have inherited a PDF voucher plugin and would like to fetch and display custom order data in the woocommerce email template. This is the original email code. I would like to display the customer billing first name.
<?php do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<p><?php printf( _n( "Hi there. You've been sent a voucher!", "Hi there. You've been sent %d vouchers!", $voucher_count, 'woocommerce-pdf-product-vouchers' ), $voucher_count ); ?></p>
<?php do_action( 'woocommerce_email_footer', $email ); ?>
Having a look through the developer documentation, we should be able to query the order object using $voucher->get_order(). I’ve tried with the following code, but getting fatal errors. I
$voucher->get_order()->billing_first_name ();
$first_name = $order->get_billing_first_name();
What am I missing?