I’ve got a very odd issue occurring. An html email that gives a link to track a package appears exactly as prepared and as expected, but for some users, it strips the equals sign and removes some characters of the query string:
PHP Code:
$url = 'https://www.fedex.com/fedextrack/?tracknumbers=' . $tracking;
$url_encoded = htmlentities($url);
$note .= '<span style="font-weight:bold;font-size:18px;">Fedex Tracking Number <a href="' . $url_encoded . '">' . $tracking . '</a></span>' .
'<br><br>' . $url_encoded;
Here is what I see when looking at the email markup in Gmail, both on desktop and mobile device:
<blockquote>
<p>
<span style="font-weight:bold;font-size:18px">Fedex Tracking Number
<a href="https://www.fedex.com/fedextrack/?tracknumbers=123456789012"
style="color:#505050;font-weight:normal;text-decoration:underline"
target="_blank">123456789012</a>
</span>
<br>
<br>
<a href="https://www.fedex.com/fedextrack/?tracknumbers=123456789012"
target="_blank">https://www.fedex.com/<wbr>fedextrack/?tracknumbers=<wbr>123456789012</a></p>
</blockquote>
Here is what some other people see when looking at the email markup:
<blockquote>
<p>
<span style="font-weight:bold;font-size:18px">Fedex Tracking Number
<a href="https://www.fedex.com/fedextrack/?tracknumbers%203456789012"
style="color:#505050;font-weight:normal;text-decoration:underline"
target="_blank">123456789012</a>
</span>
<br>
<br>
<a href="https://www.fedex.com/fedextrack/?tracknumbers"
target="_blank">https://www.fedex.com/<wbr>fedextrack/?tracknumbers</a> 3456789012
</p>
</blockquote>
So it seems that whatever is parsing the email for viewing has an issue with the question mark and equals sign of the link’s query string. It’s formatting it differently.
FYI, I’m using the simple ‘add_order_note’ function of the Woocommerce wordpress plugin…
Any ideas?