googleyberry
googleyberry

Reputation: 83

Adding http link inside displayed text - PHP (WooCommerce Email)

Im trying to add a link inside some PHP text that displays in an email sent out by woo commerce. I'd like to add a link through to my website so that where it says XXXXX below, it says 'here.' but I must be doing something wrong as the code crashes and can't be read properly with all the various things I'm trying such as print and echo.

<p><?php _e( "Your order has been received and is now being processed. We will send you another email shortly to let you know that your order has been shipped. If you'd like to track the status of your order, you can by clicking XXXXXXX. Your order details are shown below for your reference:", 'woocommerce' ); ?></p>

Thank you!

Upvotes: 1

Views: 1304

Answers (1)

Super User
Super User

Reputation: 9642

Instead of this you can divide you string in two parts like below

<p><?php _e( "Your order has been received and is now being processed. We will send you another email shortly to let you know that your order has been shipped. If you'd like to track the status of your order, you can by clicking ", 'woocommerce' ); ?><a href="http://example.com" title="">XXXXXXX</a><?php _e( "Your order details are shown below for your reference:", 'woocommerce' ); ?></p>

Upvotes: 1

Related Questions