5

So I am using ExactTarget templates and content areas to build my emails. In my templates I have AMPscript variables defined in the < head > and that will determine how elements in my content areas will render. For Example:

Inside My Template

%%[
SET @Title_Color = "#1996e6"
]%%

Inside My Content Area

...
<td class="title_text" align="center" style="font-size:20px; color: %%=v(@Title_Color)=%%;">[MY TITLE]</td>
...

Keep in mind these content areas are built as FREE FORM content areas. This is important to note as the marketers need to be able to modify the content in the WYSIWYG and still have these AMPscript variables evaluate properly.

The problem I am running into is 2 fold. I am inside of an Enterpise 2.0 environment and in some business units the above code works fine, but in some business units when I save the content area and re-open it the the AMPscript is removed completely (along with the related CSS property) and I am left with this:

...
<td class="title_text" align="center" style="font-size:20px;">[MY TITLE]</td>
...

So as a workaround I built the entire style attribute as a AMPscript variable and inserted that into the < td >. Below is my code:

Inside My Content Area

%%[
SET @Title_Style = Concat('style="font-size:20px; color:',@Title_Color,';"')
]%%
...
<td class="title_text" align="center" %%=v(@Title_Style)=%%>[MY TITLE]</td>
...

This worked for half of my business units but completely broke in the other half. For the ones that broke ET changed my AMPscript appear like the following (notice the extra quotes (") and equal sign (=) around the AMPscript in the HTML):

%%[
SET @Title_Style = Concat('style="font-size:20px; color:',@Title_Color,';"')
]%%
...
<td class="title_text" align="center" %%="v(@Title_Style)=%%"="">[MY TITLE]</td>
...

MY QUESTION:

Does anyone have any idea how to get something like this to work across the board or know why on earth the business units are behaving so uniquely?

  • Honestly, I'd rather teach the marketers to update a big AMPScript block at the top of the email (and lock down the rest of the email in the template) than use Free Form content areas. The WYSIWYG editor will jack up your AMPScript more often than not. – Adam Spriggs Oct 13 '14 at 19:40
  • As for the business unit thing...are the default headers and footers the same? What about the Sender Profiles? Both of those affect the final HTML. – Adam Spriggs Oct 13 '14 at 19:42
  • The problem with updating a big ampscript block is inserting HTML in a variable is difficult if your not handy. The brackets coupled with good HTML keep the Marketer from removing any AMPscript when editing. I'll check the headers and footers but how would that affect the HTML? All I do is save the content and re-open it. I will check though. – DigitalMC Oct 14 '14 at 15:49
0

I'm doing something similar in a few of my email templates. Try something like this:

%%[ var @Title_Color
SET @Title_Color = "#1996e6"
]%%

...
<td class="title_text" align="center" style="font-size:20px; color: %%=Concat(@Title_Color)=%%;">[MY TITLE]</td>
...

EDIT: didn't realize this was an old post. Sorry!

| improve this answer | |
  • No worries bud, thanks for the reply. How is this different than the above solution I tried? I found in some Enterprise 2.0 accounts ET will malform any AMPscript within the style attribute which is what was initially causing the headache. – DigitalMC Mar 16 '15 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.