Skip to main content

Notifications

Announcements

No record found.

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

Send Contacts Event Sessions they have registered to attend?

Posted on by 45

We are trying to create a dynamic email that will use a for each to send the details for the individual sessions that a users has registered for. We have tried a bunch of variations of:

<!-- {{#each contact.msevtmgt_eventregistration_contact_msevtmgt_contactid}} -->
<tr>
<th scope="row"></th>
<td>{{this.msevtmgt_startTime}}</td>
<td><a href="">{{this.msevtmgt_name}}</a></td>
<td>abcde</td>
</tr>
<!-- {{/each}} -->
What are we doing wrong?
  • Suggested answer
    ShravanSuri Profile Picture
    ShravanSuri 1,255 on at
    RE: Send Contacts Event Sessions they have registered to attend?

    Hey Scott,

    Here's how for-each works - it will loop through related entities to a contact (of a particular relationship). Within each loop, you can add a "if" condition - to check whether that related entity matches some criteria - and then perform actions based on that.

    Let's look at an example.

    You have an event with 3 sessions (that you want to display in chronological order, so this tip is especially valuable to you).

    Session 1 - 10 AM
    Session 2 - 11 AM
    Session 3 - 1 PM.

    What you need to do is create an email for that particular event (which you're doing anyway) - and create a table/list of ALL sessions. Then, wrap each list item in a for-each loop (and if condition) to check if the person receiving that email registered for that session at all. (Yes, this is a bit time consuming and we're making it easier in the future - but this workaround should get you unblocked for now).

    So this means your email would look like: (event ID for your event is 123)

    <For all session registrations of this contact> <if eventID of this session reg == '123' and sessionID == 'sessionID of session 1'>

    Session 1 - 10 AM

    </if></for>

    <For all session registrations of this contact> <if eventID of this session reg == '123' and sessionID == 'sessionID of session 2'>

    Session 2 - 11 AM

    </if></for>

    <For all session registrations of this contact> <if eventID of this session reg == '123' and sessionID == 'sessionID of session 3'>

    Session 3 - 1 PM

    </if></for>

    This way, for each row of the list, the system will check if the person registered for that particular session - and only then display the row. 

    Please reply here if you'd like help with the code here. Please note that a frequent request of event communication is not just to display the list of sessions, but to display them in a particular order/format. This method should let you tightly control such a display.

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