Hi,
I have created a Marketing Email containing Dynamic Content which represents Web Order related to each Contact record.
Example. If a contact leaves their shopping cart online an email will be triggered from Dynamics Marketing. The email will then contain a link to their cart.
Currently, the email lists all Web Order records related to a Contact but I only want to show the most recent one. What do I need to add to my function to solve this?
Below you can see how it is currently set up:
{{#each contact.orkla_weborder_contact_orkla_consumerid}}
{{#if (eq this.orkla_status 'Abandoned Basket')}}
{{this.orkla_link}}
{{/if}}
{{/each}}
Thanks in advance!
Br, Joakim
Hi Nya.
Thanks for the suggestion, I will definitively look in to this.
However, would it be possible to simply add a {{return false}} parameter into the code to break the loop?
I haven't worked out how to properly add it to the code as I am getting some syntax errors.
Hi,
To show the link of the order, you can set the Content assist as the following way
To filter the order with certain status, you can add a condition in the workflow:
If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.
Best Regards,
Nya
Thanks for your reply, Nya.
With your suggestion, how will we be able to only identify those orders with status = Abandoned Cart?
What we need to display in the email is the actual link that goes to the shopping cart. We don't simply want to show the GUID or ID of the most recent order.
Example:
On the Web Order table there are two columns of interest: link & status.
If a contact has a related web order and the status = abandon cart, then the cart url in on the link column should be displayed in the marketing email.
I am not too sure if that is possible to do with your suggestion by simply using assist edit?
Hi Joakim,
It is recommended to create a custom field whose data type is Lookup in Contact entity. It can ensure a 1: N relationship between Web Order and Contact entity.
When a Web Order is being related to a contact (the contact of the web order changed), update the field with a workflow or flow.
After setting these above, you can insert the record with Content assist instead of Code block.
It allows to insert the most recent record of Web Order.
If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.
Best Regards,
Nya
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156