Prettying up AMPScript in emails

When you’re creating a dynamic email in Salesforce Marketing Cloud using AMPScript, things can get muddled up with non-HTML code real fast — so muddled it’s hard to recognize the basic layout of the email.  Sometimes it’s helpful to hide the AMPScript in a way that doesn’t affect the functionality. Here’s a trick that I use on a regular basis.

Hide your init block in with a styled DIV

I normally use these at the top of an email for initialization of variables, etc. Simply edit the content area to view the full code.

DO NOT use HTML comments to hide AMPScript. It will screw up the automatic text version of your email!

Leave a Reply

1 Comment on "Prettying up AMPScript in emails"

Notify of
Sort by:   newest | oldest | most voted
Vic Dinovici

Great article series about Exact Target, Adam!

For me the most problems rise into the plain text file with AMPscript. Where is AMPscript remains an empty space and is just awfull sometimes as I spend more time to make things nicer into the .txt file than coding.

Thanks for tips again, just subscribed to your feeds.