Hour Alerts Job #
The Hour Alerts job monitors service contract hour consumption and sends warning emails when usage crosses configured thresholds.
What DMSI Service Management Adds
Hour-based contract monitoring is entirely new to this extension. Core has no concept of service hours.
What the Job Checks #
On each run (every hour), the job queries all contracts with status = active and calculates:
usage_percent = (hours_used / allocated_hours) * 100
It then compares this percentage against two configurable thresholds:
| Threshold | Default | Setting |
|---|---|---|
| First alert | 70% | Services > Settings > Alerts > Hour Alert Threshold 1 |
| Second alert | 90% | Services > Settings > Alerts > Hour Alert Threshold 2 |
Alert Deduplication #
The job tracks which alerts have already been sent for each contract using a metadata flag. A threshold alert fires only once per threshold crossing per contract. If the same contract reaches 72% and stays there for several days, only one first-threshold alert is sent.
If a contract’s hours are adjusted (either by an admin editing the contract or through a renewal that resets balances), the deduplication flag can reset and the alert may fire again when usage crosses the threshold on the new balance.
What Happens on Alert #
When a threshold is crossed:
- The job queues an
hour-usage-alertemail via Action Scheduler. - The email is sent to both the customer and the admin notification address.
- The alert is recorded in the contract’s metadata to prevent duplicate sends.
Disabling Hour Alerts #
To stop hour alert emails from being sent, uncheck hour-usage-alert in Services > Settings > Notifications. The job will still run and check thresholds, but no emails will be queued.
