I am trying to add a Pay Now button to the bottom of the Customer invoice / Order details email that gets sent manually.
I'm getting a fatal error (Too few arguments to function 1 passed and exactly 2 expected) when running this code:
//Add Pay Now button to invoice email
add_action('woocommerce_email_footer', 'rnr_customer_order_invoice_paynow',20,2 );
function rnr_customer_order_invoice_paynow($order, $email) {
if ( $email->id == 'customer_invoice' ) {
$pay_now_url = esc_url( $order->get_checkout_payment_url() );
echo '<a"href=" ' . $pay_now_url . '">Pay Now</a>';
}
}