We are nesting AMPscript
into a content block
to insert products into email. The AMPscript is pulling from a Data Extension
where apostrophes are escaped as '
What we're trying to do is swap the '
with a regular apostrophe, and we're doing so using Replace()
, but it's not working when contained in the content block
but is working when pasted into an actual email
We then tried TreatAsContent
but it doesn't seem to work. We've tried combining both in the content block, even at the SET
statement, but no luck.
Is it possible to use Replace() in a content block and have it work within an email?
Code in Content Block:
SET @CartProductName1a = field(@row,"CartProductName1")
SET @CartProductName1 = TreatAsContent(Replace(@CartProductName1a,"'","'"))
Code in Email:
%%=Replace(@CartProductName1,''',"'")=%%