Placing Field Tags in your messages is a great way to use existing contact data to create more personalized messages. However, sometimes you don't have certain data for contacts in your account. Without this data, the tags will be replaced with no content. Obviously, this can create problems and be a blemish on an otherwise flawless email.

Tell Me More

Let's start off with an example. Let's say at the top of your message you have the following salutation:

Dear %%firstname%%,

When the message is sent, %%firstname%% will get replaced with the value stored for the contact in the firstname field. However, if there is no value in the firstname field for the contact, the salutation will read "Dear ,". Not only does this look bad, but it ruins the personalized feel of the message and leads your contacts to believe that grammar was a sour point for you in school!

Dynamic Content To The Rescue!

To prevent this little mishap from occurring, you can make use of Dynamic Content. We could remedy the issue in the example above by doing the following:

1. Click Insert Dynamic Content on the WYSIWYG editor toolbar.

2. Select the options shown in the screen shot below from the Edit Dynamic Content window.

3. Click Insert Raw Dynamic Code or Insert Re-Editable Dynamic Content.

Basically, this works by checking to see if the firstname field is blank. If it is, then the text "Valued Customer" is used. If the firstname field for the contact has a value, then the value is used. For those of you familiar with Dynamic Code, the complete code for the salutation would look something like this:

Dear {dynamic_code}{if $Contact.firstname eq ""}{literal}Valued Customer{/literal}{else}{literal}%%firstname%%{/literal}{/if}{/dynamic_code}

A contact with no value in the firstname field would see "Dear Valued Customer", whereas a contact with a value in their firstname field would see "Dear John Doe" (where John Doe is the value in the firstname field for the contact).

So now you have an easy way to handle instances when there is no data in Field Tags you use in your messages. Feel free to leave any questions or comments in the comments section below.