Hi, I need to insert a content fragment but it should be dynamic per language. I read that it can be possible using a content block.
So I created this content block
<% if(context.profile.location.countryCode == 'GB')
{%>
<%@include contentModelFragment='CMDL44' %>
<%}
else if(context.profile.location.countryCode == 'CA')
{%>
<%@include contentModelFragment='CMDL27' %>
<%}
else if(context.profile.location.countryCode == 'US')
{%>
<%@include contentModelFragment='CMDL13' %>
<%}
%>
But I have the next error
I know it says it's some kind of typo, but I can't find the solution.
So, is it possible to create dynamic content fragments with content block? Is there an issue with the "@ include" statement?
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
The dialog will always look the same no matter on the rule chosen.
Though you don't have to choose an entry from the dropdown.
You can just go ahead and e.g. enter US, GB and CA in the "variant name" field when creating the variants
Hi @Silvio6
Why would you use Dynamic Content option in the Email Designer.
You add a structure let say 1:1 column) in which you enable Dynamic Content
Drag & Drop the default Content Fragment
Go back to the Edit Dynamic Content icon
Select the 2nd label and you will see that there is no Content Fragment for your 2nd condition
Add a fragment and edit the Label to add a Condition on your case CountryCode
But in your case, why do you not use Multi-Lingual Delivery Template and you use the Country as your variance? The good thing about the Multi-lingual template is that you'll get the variant in the report
Using the multi-lingual template might be beneficial.
Hope this helps,
Thanks
Denis
Views
Replies
Total Likes
Thanks Denis. I choosed the Multilingual option.
But now I have another concern. The multilingual messages are created by default for "preferred language". I tried to create a new content block with the "Country Code" (as I have 3 different countries and each country should have a different template)
I made this
But when I go to choose the variants it keeps the "Preferred language"
and when I send the email, it doesn´t respect the "Country code" rule.
Thanks.
Views
Replies
Total Likes
The dialog will always look the same no matter on the rule chosen.
Though you don't have to choose an entry from the dropdown.
You can just go ahead and e.g. enter US, GB and CA in the "variant name" field when creating the variants
yep you're right, I was choosing an entry from the dropdown and it's not neccesary.
Thanks!
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies