*** NOTE: ALL INFORMATION IS ACCURATE AT DATE OF PUBLISHING ***
There are so many options in Realtime Marketing emails for creating conditional and personalised content. Most of it is pretty easy to add, and a few clicks of buttons and you’re on your way. What about when it comes to determining what goes in to the subject or preview text of the email? It’s not so obvious how to do that, but it’s still possible with a few clicks and pretty straightforward once you know how. Let’s take a look at how to use inline conditions in email subjects, and this example we will do it based on switching the language displayed depending on the preferred language of the recipient.
First thing, create your email. Once that’s done, click on the personalise icon from the right hand side and then click on Add condition in the Inline conditions section.
Give the first condition a name. This one will be for people who would prefer their emails in French. The condition to set would then to access a field you use on the Contact (or Lead) field to determine that language. Note that although you might see a language field, there is no point using it if you don’t ever ask the Contacts about what language they would prefer, so make sure it’s a field actually used by your organisation!
Once you’ve accessed the field, set the logic. In this case, if the Language field on the Contact equals French.
Now do the same thing again and add any other languages you want to check for. In my example I have French and German. I don’t need to add an option for English because that will end up being my default. Once you’ve added all of your conditions, click on the little code icon from the top right of the Inline conditions section.
Now you can build your condition. Pick the first condition, then add in the next one, then click on the box to add a Default content condition.
Now you just need to add in what you actually want to display in between each of the conditions. So from the code example above, you can see below where I have added in what I want the subject to be for each language.
{{#if German}}Haben Sie unsere neueste Veranstaltung gesehen {{FirstName}}?{{else if French}}Avez-vous vu notre dernier événement {{FirstName}}?{{else}}Have you seen our latest event {{FirstName}}?{{/if}}
Once you’ve put your full code together, go ahead and paste it in to the Subject field of the email.
You can preview the email to see what it will look like. First we can see it in English, because neither French nor German are found.
If you then set French (or whatever condition you have added) to True, the subject will change to display that value.
Finally, I change it to be True for German, and then we see that text instead.
So not that difficult, and yet another way to create a truly customised dynamic email to send to your Contacts or Leads. Hope this helps!
Check out the latest post:
Outbound Segments Used In Real-time Journeys Notification
This is just 1 of 474 articles. You can browse through all of them by going to the main blog page, or navigate through different categories to find more content you are interested in. You can also subscribe and get new blog posts emailed to you directly.
Hi Megan,
Great article, as usual. You have been instrumental in my continuous improving confidence with Dynamics Customer Insights.
I’ve got a hurdle. I followed the article for Lead and Contact it seems quite straight forward. Think is, I’m unsure how I would do this if the attribute I need to condition on is not Lead or Contact. For example: I have three different salutation fields against Account in case I wish to communicate to equal partners at a company, or a customer mya have directed me to contact them with formal or informal salutation. If I want to market to Accounts in a particular industry, some will have Partnership salutation others will have formal and informal. When I select the attribute for Account it wishes me to name a single record. What if I wish to communicate to more than one customer and they have different salutations? Any thoughts?
Hi Mark, hopefully I am following you. If it’s asking you to name a single record, I am guessing you picked the Account table first when you selected the attribute. Instead, pick the Contact, then the Account field from the Contact and then you should be able to get to your salutation fields and set up your conditions. Hope that helps!
Thank you, Megan, for the advice that helped with the subject line 🙂
If we want to apply inline conditions to the body of the text in the email, can we do the same as we have done for the subject of the email and if so, how would we do that?
Hi Mark, you answered your own question. Can you do the same as with the subject… YES, and how, well, the same as with the subject 😉