meta data for this page
LMS Rules & Automation
Overview
The LMS Rules engine (admin/lms-rules.php) allows administrators to configure event-driven automation — when X happens, do Y. Rules run automatically without manual intervention.
Creating a Rule
- Navigate to Admin → LMS Rules → New Rule
- Enter a rule name and description
- Configure the Trigger, Conditions, and Action
Triggers
A trigger defines the event that fires the rule:
| Trigger | Fires when |
|---|---|
| lesson.completed | A learner views and completes a lesson |
| quiz.passed | A learner submits a quiz above the pass mark |
| quiz.failed | A learner submits a quiz below the pass mark |
| badge.earned | A badge assertion is created for a learner |
| user.registered | A new user account is created |
| collection.record.created | A new record is added to a specified collection |
| collection.record.actioned | An action is taken on a collection record |
| ilt.attended | A learner is marked present at an ILT session |
Conditions
Conditions filter which events fire the rule's action. Examples:
- Lesson ID = [specific lesson]
- Badge class = [specific badge]
- Score >= 80%
- Association = [specific organisation]
Multiple conditions use AND logic — all must match.
Actions
Actions define what happens when the rule fires:
| Action | Effect |
|---|---|
| Issue badge | Create a badge assertion for the learner |
| Enrol in course | Automatically enrol the learner in a course |
| Send email | Dispatch a templated email to learner, educator, or admin |
| Create collection record | Insert a record into a specified collection |
| Trigger webhook | POST a payload to an external URL |
| Assign task | Create a task in a learner's inbox |
Dead-Letter Queue
If a rule action fails (e.g. webhook returns 500), the execution is written to the dead-letter queue:
- Navigate to Admin → LMS Rules → Dead-Letter Queue
- View the failed rule, trigger event, and error message
- Retry — attempt re-execution
- Discard — mark as permanently failed
Rule Analytics
LMS Rule Analytics (admin/lms-rule-analytics.php) shows per-rule performance:
- Total executions, successes, and failures
- Average execution time
- DLQ size per rule
See Reporting & Analytics for full details.