Search code examples
emailexacttarget

Conditional Formatting in ExactTarget Personalized Subject Line


How can I setup conditional formatting using ExactTarget personalization? I want to only show the punctuation if the first name exists.

For example, if name exists subject is NAME! Rest of Subject. but if the name field is blank then Rest of Subject.

%% first_name %%! Rest of Subject. ends up returning ! Rest of Subject. if my first_name value is blank.


Solution

  • %%[
    If Not Empty([first_name]) Or [first_name] != "" Then
        Set @salutation = Concat(ProperCase([first_name]),'! ')
    Else
        Set @salutation = ""
    EndIf
    ]%%
    

    %%=v(@salutation)=%%Rest of Subject.

    Notes:

    • This assumes that the column with first name is "first_name";
    • This assumes that the first_name column could come in as NULL or empty;
    • The space that will appear after the exclamation point is in the variable;

    Place this in the email, and in the subject line input field, insert: %%=v(@salutation)=%%Rest of Subject.