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:
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:
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156