Hello forum,
We want to sent out an e-mail marketing campaign using a custom entity for Promotional Offers related 1:n to Contacts.
On some blocks of the content, I have added custom code tile in order to perform the IF conditions in order to display or not the content depending on Contact type of Promotional Offers enrolled. If condition is fullfilled, than the related block should be displayed, otherwise it should not be displayed (in order to have one single e-mail, but with different displayed content for different contacts).
The custom code is:
<p>{{{#if (eq contact.new_angemeldetesmitgliedid 'Dynamics 365 Customer Engagement')}}<display: block>
{{else}}<display:hidden>
</display>
{{/else}}
{{/if}}
</p>
After triggering a customer journey to a sample data, the content is displayed the same regardless of the condition.
Could you please help with the solution?
Kind regards,
Jola
Can you use embedded syntax [tag:each] / [tag:if] or how it can be done ?
Example
<!--Personalised comment-->
<!-- [tag:each] CONDITION -->
<!-- {{[tag:if] (eq contact.new_angemeldetesmitgliedid 'e3c37e56-78b4-ea11-a812-000d3abaa63a')}} -->
(Code of block content)
<!-- {{/if}} -->
<!-- {{/each}}-->
<!--End of personalised comment-->
Regards,
Hi Jola,
Can you confirm if the modified code worked for you? If not, can you please create a support ticket for this issue so that the team can investigate?
Guidance on creating ticket: mbs.microsoft.com/.../CRMSupport
Please email us the ticket number on d365mktcomm@microsoft.com to follow up. :)
Thanks,
Preeti Rana
Hi Jola,
Thanks for your feedback.
As you said, we can also add code in html editor without having to add custom code tile.
Could modified code work for you now?
Regards,
Clofly
Hello Clofly,
thank you for your answer and explanation.
For us, the best way worked with inline code in html editor rather than a custom code tile. In additional to the code displayed and edited as you suggested, it was needed the starting comment:
<!--Personalised comment-->
<!-- {{#if (eq contact.new_angemeldetesmitgliedid 'e3c37e56-78b4-ea11-a812-000d3abaa63a')}} -->
(Code of block content)
<!-- {{/if}} -->
<!--End of personalised comment-->
Regards,
Jola
Hi Jola,
You said that relationship between Contact and custom Promotional Offer entity is N:1, so it seems that you condition is based on a lookup field of Contact entity?
If so, due to the original value of lookup field is saved in GUID value format of the selected record, so we should do condition checking based on GUID.
e.g:
Show different contents based on contacts' company.
Get the guid of company in URL parameter
Dynamic expression in marketing email:
{{#if (eq contact.parentcustomerid '10dcede8-e4b5-ea11-a812-000d3ab64f2b')}} Hi Clofly, we prepared a special gift for you. {{else}} Hi {{contact.firstname}}, it is glad that you can join us. {{/if}}
Result in preview mode
If contacts' company is equal to a specific company:(<display:block> in your case)
else condition:(<display:hidden> in your case)
If I set the value to accounts' name directly, then it always show content of else clause.(<display:hidden></display>)
Regards,
Clofly
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156