Home → Arctic Reservations → Emails → Placeholders & Logic
18.8. Placeholders & Logic
Placeholders
All Arctic email templates and triggers include the ability to add placeholders. When sending the template or trigger to a guest, Arctic will fill in the placeholders with the appropriate information, much like a mail merge. Placeholders allow including information about the recipient, relevant trip details and important links (such as the "Manage Activity URL").
Placeholders generally follow the basic format shown below:
{$category->name}
Placeholders always start with a curly bracket and a dollar sign. Most have two parts, the category, which groups similar placeholders together, and the actual placeholder name. The category and name are separated by a dash and a greater than symbol (making a little arrow). The placeholder then ends with a closing curly bracket.
For example, {$recipient->name}
pulls in the name of the recipient.
Some placeholders use more advanced syntax to control how dates or dollar amounts are formatted. You can learn more about these advanced formatting options in the next chapter "Advanced Logic."
All relevant placeholders are available from the "+ Add Placeholder" button available when creating or editing an email template or trigger.
Logic
In addition to just placeholders, you can include logic in your email templates to only print text in certain conditions. The sample templates include some basic logic, and the "+ Add Logic" button enables quickly inserted commonly used logic into email templates.
Below we describe some of the logic that can be added via the "+ Add Logic" button. But if you are comfortable with some basic coding, you can go further and write your own logic. The next documentation section covers some advanced coding tips.
Logic: Multiple Activities
If you frequently have multiple reservations or rentals on a single invoice, Arctic offers added logic that will help list information about all activities in the invoice email template. This ensures that all relevant information is included in the email to the guest, helping eliminate multiple confirmation emails for each activity.
The multiple activity logic is available for invoice email templates, order confirmation email templates, before balance due email triggers, and after balance due email triggers. With this tool you can easily insert the placeholders you want Arctic to display for every activity contained on a guest's invoice.
From the "Add Logic" menu, select "Invoice" and then "Multiple Activities" from the menu available to add the basic logic to your email template content (the code will be inserted where you were last typing in the email content):
{for_activities}
This will print for each activity. Use activity placeholders to add relevant information (date, time, name, etc).
{/for_activities}
You will replace the "This will print for each activity..." line with the placeholders you want Arctic to print for each activity shown on an invoice.
For example if you want to include the trip name, start date, and guest count for each reservation activity on the invoice after adding the "Multiple Activities" syntax, you will add the appropriate placeholders to your email template between the {for_activities}{/for_activities}
placeholders. At the end your email template should look something like this:
{for_activities}
**Activity Number:** {$activity->uniqueid}
**Trip Name:** {$trip->name}
**Start Date:** {$trip->start|format:'Date'}
**Start Time:** {$trip->start|format:'Time'}
**Guest Count:** {$reservation->guestcount}
{/for_activities}
This will ensure that Arctic prints the activity number, trip name, start date, start time and guest count for each reservation on the guest's invoice.
If you need rental activity information populated, you will insert rental placeholders instead of reservation placeholders.
If you have the potential for a guest to have both reservation activities and rental activities on the same invoice, you will need to include placeholders for both "reservations" and "rentals" between the {for_activities}{/for_activities}
placeholders. If you only include either rental placeholders or reservation placeholders, Arctic will only populate information for either the rentals or reservations shown on the invoice and nothing will be included for activities for which placeholders were not included.
If you need both types of placeholders (rental and reservation), you will want to use a combination of the logic framework and if statements so only the appropriate information is populated for each activity on the invoice and Arctic doesn't include line headers that are irrelevant to the current activity being listed.
Here is an example of a logic framework using if statements to include information for both reservation and rental activities when appropriate in your email template:
{for_activities}
**Activity Number:** {$activity->uniqueid}
{if $trip->name} **Trip Name:** {$trip->name}{/if}
**Start Date:** {if $trip->start|format:'Date'} {$trip->start|format:'Date'}{/if} {if $rental->start|format:'DateTime'}{$rental->start|format:'DateTime'}{/if}
{if $trip->start|format:'Time'} **Start Time:** {$trip->start|format:'Time'}{/if}
{if $reservation->guestcount}**Guest Count:** {$reservation->guestcount}{/if}{if $rental->itemcount}**Number of Items:** {$rental->itemcount}{/if}
{if $rental->items}**Items Rented:** {$rental->items}{/if}
{/for_activities}
The above will ensure that Arctic prints the appropriate information for each type of activity included on the invoice, whether reservation or rental, without populating lines that are irrelevant to the activity information being listed. With the above syntax, for each reservation on the invoice, the template will include the activity number, trip name, start date, start time, and guest count; for each rental on the invoice, the template will include the activity number, start date and time, number of rental items and item description will be included.
There is more information on if statement syntax in the "Advanced Coding" section of the "Email" chapter. If you have any trouble formatting your emails using the add logic tool, feel free to contact support and we will be happy to help.