Tracking link in WooCommerce email

I’m trying to get the tracking link added to a WooCommerce email and I think I have incorrect syntax. Would appreciate some help. Here is the section in question:

	<?php
	/* translators: %s Order date */
	printf( esc_html__( 'Tracking number : echo "   <a href=\\"https://www.fedex.com/fedextrack/?trknbr=%2$s\\">%2$s</a>";', 'woocommerce' ), esc_html($shipping_carrier), esc_html( $ups_trackingno ) );
	?>

It’s outputting this on the email message:
Tracking number : echo " <a href="https://www.fedex.com/fedextrack/?trknbr=277442046164\“>277442046164</a>”;

I want it to output this on the email (with the number being the link):

Tracking number: 277442046164

1 Like

Did you got the solution for the issue posted?

It is probably because you are using esc_html__() which is escaping the HTML.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.