Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Dynamic Email - How to show previously purchased products?

Posted on by 50

Hi,

I have to objectives that I would appreciate some advice on how to achieve. 

1. Display previously purchased products in a Dynamic Marketing Email. 

Based on the Contact table we have a related table named Web Order. How can I proprely use the #each statements to showcase Web Orders related to a Contact within a Marketing Email? 

2. Display a Contact's related Web Orders with status = Abandoned Basket.

The second objective is that I would like to showcase Web Orders related to a Contact where the Web Order have a status = Abandoned Basket. Abandoned Basket is a column on the Web Order table. 

Thanks in advance!

Joakim

  • Joakim Gunstad Profile Picture
    Joakim Gunstad 50 on at
    RE: Dynamic Email - How to show previously purchased products?

    Thank you very much Clofly for this thorough clarification!

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: Dynamic Email - How to show previously purchased products?

    Hi Joakim,

    1. Sync Web Order entity with marketing insights service:

    https://docs.microsoft.com/en-us/dynamics365/marketing/mkt-settings-sync

    (Now "Advanced Settings" is renamed to "Settings" and its UI has changed, and Marketing data configuration is renamed to Dataset configuration.)

    2. Copy the automatically generated relationship expression to email content.

    pastedimage1613544905313v1.png

    3. The dynamic expression can be put as text content or put into code element, the for-each loop would be below if lookup field of web order is called Buyer and the status field is optionset type field and 100004 is value of Abandoned status.

    ('this' represents web order.)

    pastedimage1613545653607v7.png

    Your web orders:
    
    {{#each contact.new_weborder_contact_new_buyer}}
    
    {{this.new_name}}
    
    {{/each}}
    
    
    
    Your abandoned web orders:
    
    {{#each contact.new_weborder_contact_new_buyer}}
    
    {{#if (eq this.new_status 100004)}}
    
    {{this.new_name}}
    
    {{/if}}
    
    {{/each}}

    pastedimage1613545571792v6.png

    4.

    Web order records

    pastedimage1613545507311v4.png

    Result

    pastedimage1613545490042v3.png

    Note: Currently rendered records are sorted randomly.

    More details for how to use for-each loops can be found in this section:

    https://docs.microsoft.com/en-us/dynamics365/marketing/dynamic-email-content#for-each-loops

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans