0

I am creating an email template in exact target. I do not want to use content boxes. I have this user subscriber TAG which identifies whether the user is english or german: %%InternalLanguageCode%%

I want to put all HTML in the email template and wrap the HTML in an if statement.

like:

IF %%InternalLanguageCode%% == EN 
USE THIS ENGLISH CONTENT 
ELSEIF
%%InternalLanguageCode%% == DE 
USE THIS GERMAN CONTENT

I tried the following but its not working

%%[IF %%InternalLanguageCode%% == 'en' THEN]%%
  english
%%[ELSEIF %%InternalLanguageCode%% == 'de' THEN]%%
    german
%%[ELSE]%%
    nothing
%%[ENDIF]%%

1 Answer 1

2

Double-percent notation is not for use in AMPScript blocks and functions.

I generally set a variable for each of the personalization strings -- to handle null values gracefully.

Something like this:

%%[

var @InternalLanguageCode
set @InternalLanguageCode = AttributeValue("InternalLanguageCode")

]%%

<!-- other HTML -->

%%[ IF @InternalLanguageCode == 'en' THEN]%%
  english
%%[ELSEIF @InternalLanguageCode == 'de' THEN]%%
    german
%%[ELSE]%%
    nothing
%%[ENDIF]%%

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .