All mail templates in CodexFit can be customised to include data that dynamically gets inserted when the email is sent. You have access to variables and some logic.
Show dynamic data with variables
Commonly, this would be used in a booking confirmation email so that whenever someone books into an event, they will automatically get an email containing that event's booking information like:
- Location
- Studio
- Event Name
- Instructor
- Date/time
These variables can be used to tailor that experience and are as follows:
First Name: {{ first_name }}
Last Name: {{ last_name }}
Date and time: {{ booking.event.event_date }} at {{ booking.event.event_time }}
Event: {{ booking.event.event_type.name }}
Instructor: {{ booking.event.instructor.first_name }}
Studio: {{ booking.event.studio.name }}
What variables do I have to?
If you view each email in CodexFit, you will see the variables at the top that you can use. See below for an example of the booking confirmation:
Advanced: Using metafields content in emails
You can also include metafields in emails so if you want to include some special content for that booking confirmation if it's a certain event type or event type group, you can do this too.
To add metafields onto yourevent types or event types groups, please speak with support service at CodexFit and they'll help you enable this.
Then, you can add the metafields like this:
{{{ booking.event.event_type.event_type_group.metafields.email }}}
In the above, we are telling CodexFit that whenever a booking confirmation email gets sent to include the event type group's metafield called email.
Breaking this down, you can see that the code above is broken down into:
booking.
event.
event_type.
event_type_group.
metafields.
The logic for this effectively is saying that CodexFit should start by looking at the booking, then the event itself, then the event type, and finally at the event type group's metafield called email. A bit like a chain that CodexFit needs to follow.
If we wanted to look for a metafield on the event type itself, it would look like this:
{{{ booking.event.event_type.metafields.email }}}
And finally, if the event itself had a specific metafield, we could also display that like this:
{{{ booking.event.metafields.email }}}
Advanced: Showing or hiding with logic
By using a tool called mustache, you can also show or hide information in emails if it exists. This is commonly used to decide whether or not to show someone the specific spot they booked in a room that has a layout as opposed to the number of total spaces someone has booked in a non-layout room.
For example, imagine you have a boxing studio with numbered boxing bags and customers choose a number during booking. You probably want to include that bag number in the booking confirmation email. However, imagine then that someone books into a HIIT event where there are no assigned spots. Instead, what you can do using mustache is to just tell someone how many spots they booked but not the specific number of that spot.
That would look like this:
{{#has_layout}}Spot(s) Booked: {{ slot_list }}{{/has_layout}}
{{^has_layout}}Selected Bike(s): {{ slot_total }}{{/has_layout}}
If something begins with #, this means yes and the command ends with /.
If something begins with ^, this means no and command ends with /.
So in the above code, the first line effectively says that the event does have a layout, so show the slot list (or the specific slots that someone booked) whereas the 2nd line says the layout doesn't have a layout and instead you want it to show the total slots someone booked.
We also commonly use this to send out two different emails for live digital streaming events vs in-studio events (if your CodexFit site utilised the digital studio aspect in addition to the physical bookings). These emails would be formatted like this:
{{#booking.event.video}}
EMAIL CONTENT for LIVE EVENTS
{{/booking.event.video}}
{{^booking.event.video}}
EMAIL CONTENT FOR STUDIO EVENTS
{{/booking.event.video}}