0

When building an image ref URL in Ampscript, I'm finding that it's getting mangled when saving...vs the same HTML in an HTML block (where things will save correctly). Has anyone else run into this? Is this a known issue?

Saving in HTML block -

<table width="100%" cellspacing="0" cellpadding="0">
 <tr>
  <td align="center">
   <a https:="" href="**%%=RedirectTo(Concat("https://www.website.com?",v(@utm_block)))=%%**" title="" alias="" conversion="false" data-linkto="other"><img data-assetid="87994" src="https://image.em.website.com/lib/fe8613727c640d7a72/m/1/d5d42538-602a-414c-a8ae-efad3865263a.png" height="31" width="180" style="display: block; padding: 0px; text-align: center; height: 31px; width: 180px; border: 0px;"></a>
  </td>
 </tr>
</table>

Image Block (looks fine until I save) -

<table width="100%" cellspacing="0" cellpadding="0">
 <tr>
  <td align="center">
   <a https:="" href=**"%%=RedirectTo(Concat("** title="" alias="" conversion="false" data-linkto="other"><img data-assetid="88494" src="https://image.em.website.com/lib/fe8613727c640d7a72/m/1/157625c8-38da-410e-8aaa-a6dd6d65bd38.png" height="31" width="179" style="display: block; padding: 38px 0px 0px; text-align: center; height: 31px; width: 179px; border: 0px;"></a>
  </td>
 </tr>
</table>
3

The WYSIWYG is changing AMPScript code in certain spots/ between certain characters. This is a known issue that Salesforce isn´t addressing tho. I had a ticket open for months when the Content Builder was introduced. Using HTML Block is the save way to go here.

| improve this answer | |
  • The reason for the changing of code is because the HTML needs to go through the browser (client) HTML processor, through their HTML processor in the WYSIWYG and then their storage HTML processor - then when it is viewed again, it needs to be run through these in opposite order again. The reason for this is that each step wants to ensure security for each system and remove any potential corruption from the HTML and to package it in a way that best suits the processors needs. Due to this it really is not something that Salesforce can do much about without opening huge risks. – Gortonington Feb 13 at 16:23
  • This wasn´t the case in Classic Content tho. When we were migrating Templates/ Modules from Classic to Content Builder we were able to see it work in Classic but stripping/ rearranging code in Content Builder. Does it mean, that Classic wasnt as secure? – DonL Feb 14 at 12:34
  • I would not say it was less secure, more that it did not have the same features/functionality so there was less for it to look for and alter to fit inside of its predetermined formats/requirements. Comparing those two content editors is almost like comparing apples to oranges due to the differences. – Gortonington Feb 14 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.