I'm getting an error with an IF statement, even though it was working previously.

This is my code:

Hello %%[IF Empty(@firstname) THEN]%%homeowner, %%[ELSE]%% %%=ProperCase(@firstname)=%%,%% [ENDIF]%%

This is the error I'm getting:

An IF statement is not closed with the required ENDIF statement. ClientID: ######### JobID: 0 EmailID: 0 Index: 447 Statement: IF Empty(@firstname) THEN]%%homeowner, %%[ELSE]%% %%=ProperCase(@firstname)=%%,%% [ENDIF]%%

This letter serves as formal notice of your completion date at project.

Your completion is %%[IF Empty(@closedate) THEN]%%(date unavailable, please email us) %%[E

I've checked through the code and looked at resources online, but the brackets look correct to me. What am I missing?

1 Answer 1


Found a solution: There was a space before [ENDIF] I missed because of line breaks. This is the winning code:

Hello %%[IF Empty(@firstname) THEN]%% homeowner, %%[ELSE]%% %%=ProperCase(@firstname)=%%, %%[ENDIF]%%

You must log in to answer this question.

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