Triggers

Triggers provide a way to schedule or configure automatic tasks (Actions) in Learndot. For example, triggers are commonly used to schedule class survey emails upon course completion. 

See Create Triggers to Email Class Reminders, Follow-ups and Surveys for an in-depth guide on how to use triggers.

Creating Triggers

Triggers consist of two main components: Actions and Events.

  • Action - defines some behaviour to complete (such as sending a course survey email)
  • Event - describes when to take that action (such as when a course is closed or completed)

You are also required to provide a name for your trigger.

Events

The following event types can be configured for Triggers.

Eventcom.trainingrocket.module.training.event.CourseEventEnrolmentCreateEvent
DescriptionFired whenever a new enrolment is created on a course event (private or public).
EntityThe newly created Enrolment.
Eventcom.trainingrocket.module.training.event.CourseEventClosedEvent
DescriptionFired whenever a course event is closed via the Instructor Interface.
EntityThe closed Course Event.

Actions

The following actions are currently available to be configured. Each action will have a set of options which need to be configured.

TriggerFiringTriggerAction

Used to trigger another trigger, passing a different entity. A common use case for this action is when wanting to perform another action on a collection (such as sending an email to all enrolments on a course event).

OptionDescriptionExample Value
targetFieldThe field on the events entity, containing entities to fire the next trigger with.enrolments
triggerIdThe ID of the trigger to fire for each entity in the targetField.1

ScheduleTriggerAction

Used to schedule another trigger to be fired in the future. 

OptionDescriptionExample Value
targetTriggerIdThe ID of the trigger to fire at the scheduled time.1
period.beforeOrAfterIndication of whether to schedule the notification before or after the timeField according to the period fields.before
period.daysThe amount of time in days to schedule the notification out from the timeField.1
timeFieldThe field to use as a date and time for when to send the notification, modified by the period fields.associatedEntity.startTime
timezoneFieldAn indication of the time zone the timeField date and time is in.associatedEntity.location.timeZone

NotificationSchedulingTriggerAction

Schedules a notification to be sent at some point in the future. For example, send a survey notification 10 days after a course event is closed.

OptionDescriptionExample Value
toFieldsThe field containing a contact entity to send the notification to.contact
templateIdThe ID of the template to use when sending mail.1
period.beforeOrAfterIndication of whether to schedule the notification before or after the timeField according to the period fields.before
period.daysThe amount of time in days to schedule the notification out from the timeField.1
timeFieldThe field to use as a date and time for when to send the notification, modified by the period fields.associatedEntity.startTime
timezoneFieldAn indication of the time zone the timeField date and time is in.associatedEntity.location.timeZone

To request a new event or action to allow you to complete a specific automation, please contact our Learndot Support team.