I need to have a nested if statement with some HTML inside.
%%[ IF (NOT EMPTY(@Var1) THEN ]%% <!-- HTML goes here --> %%[ IF (NOT EMPTY(@Var2) THEN <!-- HTML goes here --> %%[ ENDIF ]%% <!-- HTML goes here --> %%[ ENDIF ]%%
But if I try to set it like this I'm getting an error that the first IF statement is never closed and the code doesen't work.
What am I doing wrong? I was under the impression that AmpScript has the option to use nested if statements. Is it a syntax error or am I approaching this the wrong way?