web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Adding session information to Marketing Email

(0) ShareShare
ReportReport
Posted on by 50

We have an event with three sessions.

When a customer registers for the event they must select one of the sessions - only one.

I would like to send a confirmation email after registration which lists the session they have chosen.

I have tried using a dynamic variable {{contact.msevtmgt_sessionregistration_contact_msevtmgt_contactid}} but get an error saying I have to use #each.

I have no idea how this is supposed to work and have not been able to find any understandable explanation of how to use this.

I find it odd that something like this is not a "standard" function within the system.

Can anyone help me with setting this up?

Many thanks

Neil Smith

I have the same question (0)
  • Suggested answer
    Nya Profile Picture
    29,064 on at

    Hi Neil Smith,

    Since there is an N:1 relationship between Session Registration entity and Contact entity, the expression you provided cannot indicate a certain session registration record for a contact.

    You can refer to the following section to adjust your expression.

    For-each loops

    The code snippet could be inserted with the Code block element in the email designer.

    pastedimage1639126747541v1.png

    It would be something like:

     

    Your registered session:

      {{#each contact.msevtmgt_sessionregistration_contact_msevtmgt_contactid}}
    • name:{{this.msevtmgt_sessionid}}
    • {{/each}}

    However, it can only show the id of the session. It is previewed as:

    pastedimage1639127266911v2.png

    Since the dynamic content does not support the entity relationships that go beyond one level, only the fields in Session Registration entity can be accessed.

    If you are sure that the contact can only register one session, you can create a lookup field in Contact entity to record the session, so that you can use the expression you provided simply without a code block and show the name of the session directly.

  • NeilSmith Profile Picture
    50 on at

    Hi Nya,

    thanks for that.

    That has enabled me to show the registered session id, which is more than I had earlier.

    I now need to find out how to show the session name instead of the id.

    I'd already seen the link you sent and as I mentioned earlier I didn't rally understand anything.

  • NeilSmith Profile Picture
    50 on at

    I have managed to display the name of the registered session by using an if statement to compare the session id obtained by your code with the actual session ids as follows. It took a bit of trial and error but seems to work.

    <p>Your registered session:</p>

    <ul>

    {{#each contact.msevtmgt_sessionregistration_contact_msevtmgt_contactid}}

    {{#if (eq this.msevtmgt_sessionid '<sessionid1>')}}

    <li>Registered session: {{msevtmgt_session(<sessionid1).msevtmgt_name}}</li>

    {{else if (eq this.msevtmgt_sessionid '<sessionid2')}}

    <li>Registered session: {{msevtmgt_session(sessionid2).msevtmgt_name}}</li>

    {{else if (eq this.msevtmgt_sessionid '<sessionid3>')}}

    <li>Registered session: {{msevtmgt_session(<sessionid3>).msevtmgt_name}}</li>

    {{/if}}

    {{/each}}

    </ul>

    Don't know if this is a good method, but it works for me.

    Neil Smith

  • Nya Profile Picture
    29,064 on at

    Hi,

    Thanks for your sharing!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 79 Super User 2026 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 62 Most Valuable Professional

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 42 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans