The problem is that my special characters are breaking the way the HTML renders not only in SFMC Email Studio but also once the email is sent, however when I inspect the source there doesn't seem to be an issue. I can only assume this is some weird interaction between AmpScript and HTML.
Code Snippet (Inside HTML Email)
<script runat="server" language="ampscript">
SET @stack_name_a = Concat("Stack Jordan Limited.")
SET @stack_address_a = Concat("P<span></span>O Box 1231, Ne<span></span>wYork, NY 1<span></span>12 123 U<span></span>SA")
SET @stack_name_b = Concat("2 Stack Jordan Limited.")
SET @stack_address_b = Concat("P<span></span>O Box 1231, Ne<span></span>wYork, NY 1<span></span>12 123 U<span></span>SA")
SET @website = Concat("stackoverflow.com")
</script>
<p style="font-size: 12px; color: #666666; line-height: 150%;">
I am here to test this message because it does not properly format, this message is a by <span dir="ltr" style="direction:ltr; white-space: nowrap;">%%=v(@stack_name_a)=%%</span>, for <a href="" style="direction: ltr; color: #666666; text-decoration: none;">%%=v(@website)=%%</a> and i am glad this is working, my address is <span dir="ltr" style="direction:ltr; white-space: nowrap;">%%=v(@stack_address_a)=%%</span>. On the other hand, it does seem to break randomly, so i am sending another message by <span dir="ltr" style="direction:ltr; white-space: nowrap;">%%=v(@stack_name_b)=%%</span>, for <a href="" style="direction: ltr; color: #666666; text-decoration: none;">%%=v(@website)=%%</a> and i really hope it breaks for demo purposes, <span dir="ltr" style="direction:ltr; white-space: nowrap;">%%=v(@stack_address_b)=%%</span>.</p>
Result: I am here to test this message because it does not properly format, this message is a by Stack Jordan Limited., for stackoverflow.com and i am glad this is working, my address is PO Box 1231, NewYork, NY 112 123 USA. On the other hand, it does seem to break randomly, so i am sending another message by 2 Stack Jordan Limited., for stackoverflow.com and i really hope it breaks for demo purposes, P O Box 1231, NewYork, NY 112 123 USA.
The Problem:
P O Box 1231, NewYork, NY 112 123 USA
was rendered incorrectly, PO
should be together. I am assuming that some of the special characters I am using are breaking the interaction between AMP Script and HTML.
So far I have tried to use v
, TreatAsContent
and Concat
. I can't figure out how to resolve this. Any advice would be appreciated. Thanks.