TreatAsContentArea
This function creates a static Content Area that is stored by key for the duration of the send. It will evaluate AMPscript included in the content retrieved, with a limit of 300 unique variations. If there are more than 300 unique variations, any subsequent versions will be rendered as the first.
Arguments
TreatAsContentArea(1,2,3)
Ordinal | Type | Required | Description |
---|---|---|---|
1 | String | True | Key value that identifies the content specified by the second argument |
2 | String | True | Content to be stored |
3 | String | False | Name of the Impression Region to wrap around content |
Not a subscriber? Subscribe now.
Example
This example retrieves a test XML payload from a web service and replaces certain characters to display.
%%[
var @xmlContent
set @xmlContent = httpget("http://httpbin.org/xml")
set @xmlContent = replace(replace(@xmlContent, ">", ">"), "<", "<")
]%%
xmlContent:
%%=TreatAsContentArea("XMLContent", @xmlContent, "XML Content")=%%
Output
xmlContent:
<?xml version='1.0' encoding='us-ascii'?>
<!-- A SAMPLE set of slides -->
<slideshow
title="Sample Slide Show"
date="Date of publication"
author="Yours Truly"
>
<!-- TITLE SLIDE -->
<slide type="all">
<title>Wake up to WonderWidgets!</title>
</slide>
<!-- OVERVIEW -->
<slide type="all">
<title>Overview</title>
<item>Why <em>WonderWidgets</em> are great</item>
<item/>
<item>Who <em>buys</em> WonderWidgets</item>
</slide>
</slideshow>