& in link turning into html code - & upon upload of html file

I have a url string that contains the &, but when the template is uploaded to send from mailbuild, it revamps it and makes it an & breaking the URL.  Any ideas how to avoid that HTML character in the url string?

Ben Ben, 7 years ago

Hey snowdog, I've just tried to replicate but can't. Is this a link within a template? Are you able to post your template code?

Stig Stig, 7 years ago

I thought CM didn't alter the HTML, but & would be correct though?

According to w3.org, "If you want to use a literal ampersand in your document you must encode it as "&" (even inside URLs!)."

snowdog, does the link actually stop working when & is replaced by &? Could you post the HTML for the link?

Stig


The Campaign Monitor Blog – HTML email smarts to go with your good looks.
snowdog, 7 years ago

Hey Stig and Ben, here is the URL hard coded within the template itself.  Only after you upload the template do you see this.

http://www.chambermaster.com/directory/jsp/events/EventPage.jsp?ccid=322&eventid=1233

Something to note:  This did not happen before the migration of campaign monitor and mailbuild.  Thanks for the responses and let me know what you find.

snowdog, 7 years ago

Okay, now I see that when I even past the URL into this forum it blows it out.  Let me see if I can use the pre tag and paste the URL again:

<pre>http://www.chambermaster.com/directory/jsp/events/EventPage.jsp?ccid=322&eventid=1233</pre>

Stig Stig, 7 years ago

Hi snowdog,
thanks for the info. Could you tell me though, if the &amp; actually shows up in the address bar when you click the link?

Also, is the URL being converted to a CM url, or are you using cm_dontconvertlink?

Stig


The Campaign Monitor Blog – HTML email smarts to go with your good looks.
snowdog, 7 years ago

Hey Stig,

Thanks for testing this out for me.  Yes, when I hard code that url into the template on my end it is clean and good.  It is only when I upload the template for our client to use that mailbuild transforms that url & into &amp;.

In essence, when the template is used, it is the mailbuild tracking url you see, but when you click on that link it breaks because of the conversion.  Does that make sense?  Take that URL and put it in a template to upload.  You should see what I am talking about if you look at the final url string in the address bar after clicking on it from the active template.

Thanks Stig.

Stig Stig, 7 years ago

Hi snowdog,
I did some testing, and found that this only happens when the & has already been converted to &amp; before uploading the template. Are you using an HTML editor or something that might be converting it for you?

The quick fix would be to open it in a plain text editor right before uploading it and make sure there are no &amp;s in the urls. Let us now if it works or not.

Ben, isn't this a small bug, though? Since &amp; is the correct way to write ampersands in urls in HTML, shouldn't it be converted back when making the tracking URLs?

Stig


The Campaign Monitor Blog – HTML email smarts to go with your good looks.
snowdog, 7 years ago

Thanks Stig.

Using code side of CS4.  Doesn't do it on my preview internally.  Kind of strange.  Let me run some tests on our end.  I know the client is using Contribute to do some of her stuff for templates.  Again, I will test.  Let me know what else you find, and thank you for looking into that.

Cheers!

SnowDog

snowdog, 7 years ago

Stig,

I found out what is going on here.  It is not the upload for the template.  That I too have confirmed the template using the links properly (previewing before using the template).  It is when you actually create a campaign and the tracking links are created.  That is when it turns the & into HTML.  This is a HUGE problem for my client as they do too many custom templates for us to make a standard editable version within the system.  Any assistance or guidance would be much appreciated.

SnowDog

Stig Stig, 7 years ago

Hi SnowDog,
that's a different results than my tests.

I recommend sending the templates to support.

Either copy and paste the source code, or tell them which account -> client -> template.

Stig


The Campaign Monitor Blog – HTML email smarts to go with your good looks.
snowdog, 7 years ago

Hello Stig,

Thank you, I will do just that.

SnowDog

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098