Create Triggers to Email Class Reminders, Follow-ups and Surveys
Overview
Triggers can be used to send class reminders, follow-up's and surveys to enrolments of classes. We will use Email Templates to be sent by those triggers. Here's the full process on how to create email templates and triggers along with examples.
Creating a Class Survey Email Trigger
This page will guide you through the required steps to schedule class surveys to be sent to all enrolments seven days after the class is closed. The following components will have to be created:
- An Email Template with the survey information, which will be sent to each enrolment.
- A Trigger configured with the
NotificationSchedulingTriggerAction
action. The purpose of this trigger is to send the email template to one enrolment. - A Trigger configured with the
TriggerFiringTriggerAction
action. This trigger will be fired with a list of all the enrolments when the class is closed, after that happens it will call the previous trigger for each enrolment in the list.
Create the Email Template
To create the email template follow these steps:
- Login into the Administration and navigate to System > Content > Templates
- Click on New
Fill in the fields with the following information and click on Save
Name Survey Email Template Type Email Enabled Subject Course Survey for ${(target.session.event.displayName)!}
Content <p>Hi ${to.firstName},</p> <p>Thank you for your participation in ServiceRocket's
training, it has been a pleasure getting to know you.</p> <p>Please take a moment to tell us how we did.
We appreciate it!</p> <p><a href="[BASE_URL]/survey/${target.session.eventId}.html">
${(target.session.event.displayName)!} Survey
</a></p>Remember to change [BASE_URL] with your actual URL, otherwise the email template won't work as expected.
Supported Entity Types Enrolment
Write down the ID of the template, you'll need it in the next steps – from now on we'll refer to it as TEMPLATE ID.
See Create and Preview Custom Email Templates for more information.
Create the NotificationSchedulingTriggerAction
Trigger
To create the trigger follow these steps:
- Navigate to System > Triggers
- Click on New
Fill in the fields with the following information and click on Save
Name Send 7 day class follow-up Survey to enrolment Enabled Action scheduled send notifications
(NotificationSchedulingTriggerAction)
- Once the Trigger has been created click on Edit Options.
When the screen loads click on the plus icon
And then, enter in the following fields:
Key Value toFields contact templateId TEMPLATE IDperiod.beforeOrAfter after period.days 7 See the Triggers documentation for more information about the meaning of each of these options.
- Click on Save and write down the ID, you'll need it in the next steps – from now on we'll refer to it as TRIGGER ID
Create the TriggerFiringTriggerAction
Trigger
To create the trigger follow these steps:
- Navigate to System > Triggers
- Click on New
Fill in the fields with the following information and click on Save
Name Send 7 day class follow-up Survey to ALL enrolments Enabled Event com.trainingrocket.module.training.event.CourseEventClosedEvent
Action (Fire Trigger)
TriggerFiringTriggerAction
Once the Trigger has been created click on Edit Options
When the screen loads click on the plus icon and enter in the following fields:
Key Value targetField enrolments triggerId TRIGGER ID- Click on Save
Test the Triggers
Once the triggers have been created we need to close the event as the Trigger will fire the survey off after the event has been closed. To do this follow the next steps:
Make sure to mark the attendance before closing the class, otherwise this might not work as expected.
- Login as the Instructor of the class and navigate to the Instructor interface
Scroll down and click on the cog icon next to the required event and click on Close
Make sure to mark the attendance before closing the class, otherwise this might not work as expected.
The class has now been tagged as Closed and the triggers will fire after the allocated time.
Example Triggers
Below is a list of example predefined triggers which can be used:
Send class follow-up to enrolment after class is closed | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Name | Send class follow-up to enrolment after class is closed | ||||||||||
Enabled | ![]() | ||||||||||
Action | NotificationSchedulingTriggerAction | ||||||||||
Options |
|
Send class follow-up to all enrolment after class is closed | |||||||
---|---|---|---|---|---|---|---|
Name | Send class follow-up to all enrolment after class is closed | ||||||
Enabled | ![]() | ||||||
Event | com.trainingrocket.module.training.event.CourseEventClosedEvent | ||||||
Action | TriggerFiringTriggerAction | ||||||
Options |
|
Send one day class reminder to enrolment | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | Send one day class reminder to enrolment | ||||||||||||||
Enabled | ![]() | ||||||||||||||
Event | com.trainingrocket.module.training.event.CourseEventEnrolmentCreateEvent | ||||||||||||||
Action | NotificationSchedulingTriggerAction | ||||||||||||||
Options |
|