In a helper plugin for WooCommerce for WordPress, I’m trying to create a custom message to be sent to a buyer.
I don’t know why in all the emails that are sent out, %0d%0a is getting added behind the URL in the href attribute. I have tried several different combinations and nothing is working.
This is what I’m trying to do:
echo "<a href='$cl'> Please click here to redeem the coupon</a>";
But because %0d%0a is being added at the back of it the URL doesn’t work properly for coupon codes.
This is what the URL looks like afterwards:
The only thing that doesn’t add %0d%0a is this:
echo $cl;
But I want to be able to use the <a>
tag so that the buyer doesn’t have to click on a long URL link.
Try this
If you still have the issue, check how
$cl
was created.I really appreciate all the responses. But I just want to post the code that finally worked for me after 7 hours of work. I understand that it looks silly but this is the best I could do for now. Here’s what worked for me:
I just encountered the same issue, but I’m using ASP.NET. All I did was delete the single quote and type it again. Now it works.
There were possibly some extra invisible characters which needed to be deleted.