Mandrill Adding a Space to a URL

599 Views Asked by At

Using Mandrill I'm sending an email that has a link:

<a href="http://www.slotted.co/NzIyNnx0c2NvdHRAc2xvdHRlZC5jbw==">
  http://www.slotted.co/NzIyNnx0c2NvdHRAc2xvdHRlZC5jbw==
</a>

As expected Mandrill replaces my HREF with a tracking link:

http://mandrillapp.com/track/click/30319089/www.slotted.co?p=eyJzIjoiT1h4VE04RlV2bWp5R2YzNjZkNnNWaFpOemJ3IiwidiI6MSwicCI6IntcInVcIjozMDMxOTA4OSxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvd3d3LnNsb3R0ZWQuY29cXFwvTnpJeU5ueDBjMiBOdmRIUkFjMnh2ZEhSbFpDNWpidz09XCIsXCJpZFwiOlwiM2NmMWE4MzUzNGE1NDg4ZTg1OTUwMDkxZmFhY2M5NTNcIixcInVybF9pZHNcIjpbXCI3YWM1ODFiMTJkY2E0YWM4YzZlMmM3ZDU2OWU2YzQ5MmMxNDIxMDJmXCJdfSJ9

This link redirects to:

http://www.slotted.co/NzIyNnx0c2%20NvdHRAc2xvdHRlZC5jbw==

Notice the extra %20 in the middle of the path which obviously breaks the link. You can try it yourself.

Seems like a bug, but I'm still on the free plan, so no way to report it. Any suggestions?

1

There are 1 best solutions below

0
On

See this answer:

We typically see this kind of issue with SMTP libraries or frameworks that generate HTML with no true line breaks. The SMTP specs state that the line length for email shouldn't exceed 1000 characters. When that limit is reached, a line break gets inserted automatically when the message data is being transmitted over SMTP. This unfortunately often happens right in the middle of a word or a URL, for example. You'll want to take a look at your SMTP library to see if you can modify how line breaks are being handled.

If you're using HTML line breaks like <br> that are being used to indicate a break, those unfortunately won't help in this case. Adding your own line breaks (not HTML line breaks, but actual line breaks in the data such as a newline or end of line - usually \r\n - will help ensure that the forced line breaks aren't arbitrarily added in the SMTP conversation in inconvenient places.