Do you know If It is possible to assign a variable that has dynamic content on it?. Similar to:
VAR @HTML
SET @HTML BEGIN
Hi, Miguel your email is: %%=TreatAsContent(@email)=%%.
Thanks for using our services Date %%Date%%.
SET @HTML END
And then access the variable @HTML that contains custom html and other variables and play with it?
Obviously SET @HTML BEGIN and SET @HTML END won´t work but I just wanted to know If there is any workaround for this.
Best Answer
It might be helpful to read over the official AMPScript Syntax Guide.
Here's an example:
Use
%%[
and]%%
to delimit your AMPScript blocks, then reference variables with the%%=v(@varName)=%%
syntax outside of the AMPScript block.EDIT: You can always add HTML content to an AMPScript variable using the content area/block functions:
EDIT: There are some more complete examples here: