customizing email language for better personalization

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered
Is there a way to use the personalization tag only if that field is populated and a fallback text if it isn't?

For example could I use, "First Name, did you know cats are better than dogs?" and if they don't have a first name in the database replace it with "Did you know that cats are better than dogs?" In other words, I don't want a placeholder for the personalization, I want to omit. Is there a code that I could use?
Photo of Mandate Media

Mandate Media

  • 33 Posts
  • 11 Reply Likes

Posted 4 years ago

  • 0
  • 1
Photo of Sam Collis

Sam Collis, Customer Support Specialist

  • 252 Posts
  • 59 Reply Likes
Hi there!  Thanks for a really great question.

You can choose to bypass putting a default placeholder by adding a blank space between the quotation marks within your personalization tag, like so [% member:first_name default=" " %].  This will produce nothing if there is no first_name to bring into the email.

To address your specific example, the issue here would be the capitalization of the first letter of the question.  This is because you won't be able to change that letter based on the value of first_name, which means you would need to find somewhere else in the question to put the personalization tag.  This is one of the main reasons that it's advisable to use a placeholder.

So although you can bypass using a placeholder, the fact that you won't be able to change the structure of the sentence means that it's probably better to use one.

Please feel free to ask any follow-up questions here.
Photo of Mandate Media

Mandate Media

  • 33 Posts
  • 11 Reply Likes
Thanks for the answer, unsatisfactory though it may be.  It'd be great to get some logic into the editor.  Another email platform we use handles it like this:

{% if firstname %}{{firstname}}, did{% else %}Did{% endif %} you know cats are better than dogs?

That would produce:
* Personalized:  Sam, did you know cats are better than dogs?
* Default: Did you know cats are better than dogs?

Any chance of adding some basic logic to the feature roadmap at Emma?
Photo of Emily Hollingsworth

Emily Hollingsworth, Alum

  • 2203 Posts
  • 158 Reply Likes
Hi there -- I'm going to run this Idea by our Product Team to see if it fits into any of our upcoming audience work. I'll report back with a status update. Thanks for sharing. :)
Photo of Emily Hollingsworth

Emily Hollingsworth, Alum

  • 2203 Posts
  • 158 Reply Likes
Official Response
Hi again! After further digging with the product team, I learned that our dynamic content feature actually fits the bill here! You can use dynamic content tags to send varying versions of content in your mailing based on conditions you set. Here's an example:

[% if member:name_first != "" %]

[% member:name_first default="" %], did you know cats are better than dogs?

[% else %]

Did you know cats are better than dogs?

[% endif %]

Dynamic content checks to see if the name field is empty. If it's not empty and a name exists, the text with the personalization tag displays. 

If the field is empty, the generic text displays. 

You can read more about dynamic content here in our Resource Center. Let me know if you have any questions!
Photo of Mandate Media

Mandate Media

  • 33 Posts
  • 11 Reply Likes
This is great! Can we use dynamic personalization in a subject line as well?
Photo of Mandate Media

Mandate Media

  • 33 Posts
  • 11 Reply Likes
Ping!  The dynamic personalization in content is working great.  But we're still wondering about using it in subject lines.
Photo of Emily Hollingsworth

Emily Hollingsworth, Alum

  • 2203 Posts
  • 158 Reply Likes
You sure can! As always, we encourage you to test before sending. :)