0

we just noticed for the emails where we call a table for example that is coded dynamically in the AMPscript block (at the top, outside of the HTML tag), in the text version we can see the HTML (TABLE, TR, TD) along with the copy. It should be only text in the text version.

E.g.

%%[
Var @table
Set @table = '
<table>
<tr>
<td>some text</td>
</tr>
</table>
'
]%%
<HTML>
<body>
%%=v(@table)=%%
</body>
</HTML>

The result is:

<table><tr><td>some text</td></tr></table>

1 Answer 1

2

Using TreatAsContent should resolve that

%%[
Var @table
Set @table = '
<table>
<tr>
<td>some text</td>
</tr>
</table>
'
]%%
<HTML>
<body>
%%=treatascontent(v(@table))=%%
</body>
</HTML>
6
  • This is exactly right. Using the V function just outputs the content, where using the treatascontent function will render the content as it would were it a content area in portfolio. This will show the renderer that the HTML tags are in fact HTML and not text. Jan 28, 2016 at 13:13
  • although you don't need the v function inside the treatascontent. E.g. %%=treatascontent(@table)=%% should work. Jan 28, 2016 at 13:15
  • thanks but this doesn't solve the issue. The HTML code from within the AMPscript block from outside the HTML tag still shows up in the plain text email.
    – Snowalker
    Feb 1, 2016 at 18:49
  • Are you putting the AMPScript directly in the text body of the email or are you leaving the text body blank so that it generates it based on the HTML body?
    – Mac
    Feb 2, 2016 at 0:44
  • it's as per example. The logic is in the AMPscript block outside of the HTML.
    – Snowalker
    Feb 2, 2016 at 13:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .