1

Internal Notification Emails For Event Forms In Realtime Marketing

 3 months ago
source link: https://meganvwalker.com/event-forms-in-realtime-marketing-notifications/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Internal Notification Emails For Event Forms In Realtime Marketing

2024-02-20
*** NOTE: ALL INFORMATION IS ACCURATE AT DATE OF PUBLISHING ***

I’ve previously written about creating internal notification email for Realtime Marketing Form Submissions. This post is an extension of that, and covers the scenario of someone submitting a Realtime form that is actually an event Registration form. You can use just one form for events, and link it to multiple events. If you get form submission notification emails, the name of the form would be the same every single time. The act of submitting the form creates the same type of record, a Form submission… but with one difference. When an event Registration form is submitted, the Form submission record gets linked back to an Event Registration record. This is what can be used to either stop a process from sending an internal email, OR modify the email to also include details about and links to the event. Let’s take a look!

When creating an event using Realtime, you can link it to use a form. There is one already created for you called ‘Default registration form’. There is no need to create a new form for each event. When clicking the Copy Javascript code, a value is passed through the code so that when someone registers, their Event Registration record is linked to the correct event.

form-linked-to-event.jpg
Click to view in detail

If we look at the Submissions tab on the event registration form, you can see there are two submissions. They show a link to the related Event Registration AND which Event each Event Registration is linked to.

event-registrations-on-form-1024x280.jpg
Click to view in detail

This is the blog post I was referring to: Creating Notification Emails For Realtime Marketing Forms. So take a look at that first as this will give you all of the details required to create a flow in Power Automate and actually get all of the information about the form including the responses given to each question/field, and format it in a nice little table within the email. After reviewing that blog, we will pick up at the end. The last step simply uses an Outlook send email step to send the internal notification. This is what the original notification would look like without any modifications. So the form name is default registration form rather than anyone knowing what event it is for.

original-email.jpg
Click to view in detail

Instead, the last step will be a condition check like this. Search for the Event Registration field that should be available from the original trigger of the flow. Set the condition to ‘is equal to’ and then set null via the expression option.

check-for-event-registration.jpg
Click to view in detail

Now move your existing email in to the Yes path of the condition. We are saying, if the Event Registration field is empty (equal to null), send this email that is about the form submission.

send-regular-notification.jpg
Click to view in detail

Now we need to add in some logic on the no condition for when the Event Registration field contains data, and therefore does not equal null. The first step is to use a Get row by ID. We are going to find the Event Registration record that was created and add in the Event Registration field from the original trigger as the Row ID. Add msevtmgt_eventregistrationid in to Select columns as that is all we need from the Event Registration table. We can use the Expand Query to get the ID and name of the Event, and the Full Name of the Contact registered.

msevtmgt_EventId($select=msevtmgt_eventid,msevtmgt_name),msevtmgt_ContactId($select=fullname)
msevtmgt_EventId($select=msevtmgt_eventid,msevtmgt_name),msevtmgt_ContactId($select=fullname)
get-event-registration-information.jpg
Click to view in detail

These next two steps are not needed, but the person getting the notification will definitely thank you for it! We can use the following code to generate a direct link to the Event Registration record that was created. Add this in to a Compose action step in the flow.

<a href="https://@{uriHost(outputs('Get_Event_Registration')?['body/@odata.id'])}/main.aspx?pagetype=entityrecord&etn=msevtmgt_eventregistration&id=@{outputs('Get_Event_Registration')?['body/msevtmgt_eventregistrationid']}">@{outputs('Get_Event_Registration')?['body/msevtmgt_contactid/fullname']}</a>
<a href="https://@{uriHost(outputs('Get_Event_Registration')?['body/@odata.id'])}/main.aspx?pagetype=entityrecord&etn=msevtmgt_eventregistration&id=@{outputs('Get_Event_Registration')?['body/msevtmgt_eventregistrationid']}">@{outputs('Get_Event_Registration')?['body/msevtmgt_contactid/fullname']}</a>
create-link-to-event-registration.jpg
Click to view in detail

Then we can do the same again with another Compose action step, but this time generate a link to the Event the person registered for.

<a href="https://@{uriHost(outputs('Get_Event_Registration')?['body/@odata.id'])}/main.aspx?pagetype=entityrecord&etn=msevtmgt_event&id=@{outputs('Get_Event_Registration')?['body/msevtmgt_EventId/msevtmgt_eventid']}">@{outputs('Get_Event_Registration')?['body/msevtmgt_eventid/msevtmgt_name']}</a>
<a href="https://@{uriHost(outputs('Get_Event_Registration')?['body/@odata.id'])}/main.aspx?pagetype=entityrecord&etn=msevtmgt_event&id=@{outputs('Get_Event_Registration')?['body/msevtmgt_EventId/msevtmgt_eventid']}">@{outputs('Get_Event_Registration')?['body/msevtmgt_eventid/msevtmgt_name']}</a>
create-link-to-event.jpg
Click to view in detail

Now I can add in a new Outlook send email action step but adjust the subject and body of the email to include links back to the Event and Event Registration instead of the Form itself. If you aren’t sure about how to build the email out, again, check out this post where the original details are coming from.

send-notification-with-event-details.jpg
Click to view in detail

Now the email notification includes the name of the Event in the subject, and direct links back to the Event itself, and the Event Registration record that was created. A much nicer process! Of course, if you don’t want any email notifications for those submissions that are for Events, just don’t add anything at all to the No path on your new condition. Simple!

event-notification-email.jpg
Click to view in detail

D365 Marketing Weekly Have you seen the D365 Marketing Weekly newsletter yet?
A weekly issue covering features, functionality and news on the topic of Marketing, specifically covering Dynamics 365 Marketing and other interesting tools and tips for anyone interested in the subject.
Subscribe Here

This is just 1 of 440 articles. You can browse through all of them by going to the main blog page, or navigate through different categories to find more content you are interested in. You can also subscribe and get new blog posts emailed to you directly.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK