SLA Alerts and Email Digest
This page documents the SLA alert system and email notifications for complaints.
Overview
The SLA alert system allows you to:
- Detect complaints approaching their deadline
- Send notifications to agents and supervisors
- Generate periodic digest reports
- Automatically escalate overdue complaints
Architecture
┌─────────────────────────────────────────────────────────────────────────┐
│ SLA ALERT SYSTEM │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Cron Job │ --> │ Deadline │ --> │ Send Email │ │
│ │ (Daily) │ │ Detection │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Automatic │ │ Coordinator│ │
│ │ Escalation │ │ Digest │ │
│ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
Notification Types
| Type | Trigger | Recipient |
|---|---|---|
| Pre-deadline alert | 24h before deadline | Assigned agent |
| Deadline alert | Day of deadline | Agent + Supervisor |
| Overdue alert | Deadline passed | Supervisor + Coordinator |
| Daily digest | Every day at 8am | GRM Coordinator |
| Weekly digest | Monday 8am | GRM Manager |
Digest Service (PlainteDigestService)
Features
- Aggregation of statistics by period
- Identification of at-risk complaints
- HTML and text report generation
- Automated sending via cron
Included Statistics
| Indicator | Description |
|---|---|
| Open | Newly created complaints |
| In progress | Complaints being processed |
| Resolved | Complaints resolved in the period |
| Overdue | Complaints exceeding SLA |
| At risk | Complaints approaching deadline (< 24h) |
Test Endpoint
Send Digest Manually
POST /api/plaintes/digest/send
Request Body
{
"type": "daily",
"email": "coordinator@example.com",
"periode": "2026-06-11"
}
Response
{
"success": true,
"message": "Digest sent to coordinator@example.com",
"data": {
"plaintesOuvertes": 15,
"plaintesEnCours": 45,
"plaintesResolues": 12,
"plaintesEnRetard": 3,
"plaintesARisque": 8
}
}
Configuration
Environment Variables
# Enable notifications
PLAINTES_NOTIFICATIONS_ENABLED=true
# Coordinator emails
PLAINTES_COORDINATOR_EMAILS=coord1@example.com,coord2@example.com
# Digest send times
PLAINTES_DIGEST_DAILY_HOUR=8
PLAINTES_DIGEST_WEEKLY_DAY=1
# Alert thresholds (in hours)
PLAINTES_SLA_ALERT_HOURS=24
PLAINTES_SLA_URGENT_HOURS=6
Configuration in reference.php
'plaintes' => [
'notifications' => [
'enabled' => true,
'digest' => [
'daily' => true,
'weekly' => true,
'monthly' => true,
],
'alerts' => [
'pre_deadline' => 24, // hours
'deadline' => 0,
'overdue' => -1,
],
],
'coordinator_emails' => [
'coord@example.com',
],
],
Console Command
Send Digest Manually
php bin/console app:plainte-digest daily
php bin/console app:plainte-digest weekly
php bin/console app:plainte-digest monthly
Check SLA
php bin/console app:plainte-check-sla
This command:
- Identifies at-risk complaints
- Sends appropriate alerts
- Escalates overdue complaints
Email Template
Daily Digest Structure
<h2>GRM Report - [DATE]</h2>
<h3>Summary</h3>
<table>
<tr><td>New complaints</td><td>15</td></tr>
<tr><td>In progress</td><td>45</td></tr>
<tr><td>Resolved today</td><td>12</td></tr>
<tr style="color: red"><td>SLA overdue</td><td>3</td></tr>
</table>
<h3>Urgent Complaints</h3>
<ul>
<li>PLT-2026-001234 - Payment not received (deadline: tomorrow)</li>
<li>PLT-2026-001235 - Amount error (overdue: 2 days)</li>
</ul>
<h3>By Category</h3>
...
Automatic Escalation
Escalation Rules
| Condition | Action |
|---|---|
| SLA exceeded by 24h | Supervisor notification |
| SLA exceeded by 48h | Level 2 escalation |
| SLA exceeded by 72h | Coordinator alert |
Workflow
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Overdue │ --> │ Agent │ --> │ Escalation │
│ complaint │ │ Alert │ │ Supervisor │
└──────────────┘ └──────────────┘ └──────────────┘
│
▼
┌──────────────┐
│ Coordinator │
│ Notification │
└──────────────┘
SLA Statistics API
Global Statistics
GET /api/plaintes/stats/sla
Response
{
"success": true,
"data": {
"tauxRespectSLA": 92.5,
"tempsResolutionMoyen": 3.2,
"plaintesEnRetard": 8,
"plaintesARisque": 15,
"parPriorite": {
"urgente": {"total": 10, "enRetard": 1},
"haute": {"total": 25, "enRetard": 3},
"moyenne": {"total": 45, "enRetard": 4},
"basse": {"total": 20, "enRetard": 0}
},
"evolution": [
{"date": "2026-06-05", "tauxSLA": 91.2},
{"date": "2026-06-06", "tauxSLA": 92.1},
{"date": "2026-06-07", "tauxSLA": 92.5}
]
}
}
Notification Customization
Per Team
Each team can have its own settings:
{
"equipe": "Oio Team",
"notifications": {
"digestEnabled": true,
"alertsEnabled": true,
"escalationEnabled": true,
"recipients": ["supervisor.oio@example.com"]
}
}
Per Complaint Category
Sensitive categories (GBV, SEA/SH) have specific rules:
- Reduced SLA deadlines
- Priority notifications
- Immediate escalation to coordinator
Best Practices
:::tip Recommendations
- Monitor digests: Read the daily digest every morning
- React to alerts: Pre-deadline alerts help avoid delays
- Analyze trends: Use weekly stats to improve processes
- Update contacts: Ensure emails are current :::