Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Abandon Cart Email - Show Last Web Order

(0) ShareShare
ReportReport
Posted on by 50

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

  • Joakim Gunstad Profile Picture
    Joakim Gunstad 50 on at
    RE: Abandon Cart Email - Show Last Web Order

    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.

  • Suggested answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: Abandon Cart Email - Show Last Web Order

    Hi,

    To show the link of the order, you can set the Content assist as the following way

     pastedimage1622613239299v2.png

    To filter the order with certain status, you can add a condition in the workflow:

     pastedimage1622613235932v1.png

    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

  • Joakim Gunstad Profile Picture
    Joakim Gunstad 50 on at
    RE: Abandon Cart Email - Show Last Web Order

    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?

  • Suggested answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: Abandon Cart Email - Show Last Web Order

    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.

     pastedimage1622513846150v1.png

    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.

    pastedimage1622513925973v3.png

    pastedimage1622513966322v6.png

    pastedimage1622513948939v4.png

    After setting these above, you can insert the record with Content assist instead of Code block.

     pastedimage1622513977072v7.png

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans