Treats a string as though it came in from a content area. To retrieve tracking information associated with these strings, include the httpgetwrap string in embedded links.
Always sanitize user input within a TreatAsContent() block. Remove, escape, or disallow input that contains HTML tags or AMPscript code, or use an allowlist of safe characters.
Warning
Availability
Marketing Cloud Engagement
✅ Yes
Marketing Cloud Next
❌ No
Syntax
1TreatAsContent(stringToReturn)
The TreatAsContent() function has one parameter:
stringToReturn (string): Required. The string to return as content.
Usage
This example returns a string of text. If the content contains personalization strings, the function replaces them with the appropriate data.
1TreatAsContent(Field(@row,'Content'))
Use this function only with data that has been reviewed and optimized to appear as content.