Adding Related Events to Confirmation Email
To: Chenier, John
Wed 6/5/2024 3:12 PM
Hi John,
I’m going to reply via email and cc’ the Slate team because I think this will probably be useful for everyone.
This is the template for the event: https://vet.admissions.tufts.edu/manage/event/form?id=11185942-e5e0-4713-b5d4-559eb00676e9
John wanted to include a line-separated list of related events that the registrant selected when they submitted the registration form in the confirmation email. Slate does provide documentation for this, but it is really vague and obtuse, so it took some decoding. (It’s helpful to also know about liquid markup looping which is documented more helpfully.)
Step 1 is that you need to add an export key to the Related Events Selector in the registration form. Without a key (this was null until I changed it) the merge fields you need for the email won’t show up in the message tool. So you don’t actually have to add an export for this in the “Edit Conditions” menu in the message.
Once you have the export key, you should now get additional exports:
These are the exports that the documentation is talking about when it is referencing merge fields. I decided to use the key ‘related_events’ but the example in the documentation is ‘info_session’.
In addition to getting those fired up, you then need to use some liquid markup looping to get them to merge into the email in a certain format. The documentation shows you the code but doesn’t actually explain really what it is doing. Here is what I added to your email:
The pink is whatever key you give to your Related Events Selector in the form.
Everything in blue is Slate-configured things you can add (poorly explained in the documentation).
Yellow is “the object” which you get to name. As long as all the yellows match, the coding will work, and you can use whatever name you want. I kept ‘event.’ Basically, you are saying “We’re going to refer to each of the rows/objects that are being collected in that related event selector as ‘event’. For each ‘event’ give me the datetime value formatted this way, plus a hypen, and then add the summary of the event. Repeat that over and over until there are no more events to display.”
The green is the HTML to put it in an unordered bulleted list.
The end result is:
If you want to use this in other mailings, all you need to do is make sure to give the related event selector a key of ‘related_event’ – then you can literally copy and paste the entire code snippet above into a different email (or confirmation page, or whatever) and it should work.
Ta da!
Best,
Helen R. Williams
Senior Business Analyst
Tufts Technology Services (TTS)