Notification Types Catalog
Complete catalog of all notification types in the Tellus EHS platform — implemented, planned, and future.
Table of Contents
- General Platform Notifications (25 types)
- Training Notifications (7 types)
- Email-Worthy Types
- Future Module Notifications
- Notification Type Trigger Map
- Settings & Preferences per Type
General Platform Notifications
Stored in unified notifications table. 25 general types across 6 categories + 7 training types.
Category: workflow (Plan Lifecycle)
| Type | Title Template | Message Template | Trigger Point | Recipients | Status |
|---|---|---|---|---|---|
plan_created | "New Plan Created" | "{actor_name} created plan '{plan_name}'" | HazComPlanService.create_plan() | All company users (minus actor) | Implemented |
plan_published | "Plan Published" | "{actor_name} published plan '{plan_name}'" | POST /api/v1/hazcom/plans/:id/publish | All company users (minus actor) | Implemented |
plan_archived | "Plan Archived" | "{actor_name} archived plan '{plan_name}'" | POST /api/v1/hazcom/plans/:id/archive | All company users (minus actor) | Implemented |
plan_shared | "Plan Shared With You" | "{actor_name} shared plan '{plan_name}' with you" | Plan sharing API | Specific shared users | Implemented |
section_completed | "Section Completed" | "{actor_name} completed section '{section_name}' in plan '{plan_name}'" | Section update API | Plan collaborators | Implemented |
plan_approved | "Plan Approved" | "{actor_name} approved plan '{plan_name}'" | Approval workflow | Plan owner + reviewers | Implemented |
plan_rejected | "Plan Rejected" | "{actor_name} rejected plan '{plan_name}'" | Approval workflow | Plan owner | Implemented |
plan_comment | "New Comment on Plan" | "{actor_name} commented on plan '{plan_name}'" | Comment API | Plan collaborators (minus actor) | Implemented |
plan_revision_requested | "Revision Requested" | "{actor_name} requested revision for plan '{plan_name}'" | Review workflow | Plan owner | Implemented |
Category: inventory (Chemical Inventory)
| Type | Title Template | Message Template | Trigger Point | Recipients | Status |
|---|---|---|---|---|---|
chemical_added | "New Chemical Added" | "{actor_name} added '{chemical_name}' to {site_name}" | POST /api/v1/chemiq/inventory | Site users | Implemented |
chemical_updated | "Chemical Updated" | "{actor_name} updated '{chemical_name}' at {site_name}" | PUT /api/v1/chemiq/inventory/:id | Site users | Implemented |
chemical_removed | "Chemical Removed" | "{actor_name} removed '{chemical_name}' from {site_name}" | DELETE /api/v1/chemiq/inventory/:id | Site users | Implemented |
inventory_import_complete | "Import Complete" | "Bulk import completed: {success_count} chemicals added, {error_count} errors" | Background: handle_bulk_import() | Import initiator | Implemented |
sds_attached | "SDS Attached" | "SDS for '{product_name}' has been attached automatically" | Background: handle_sds_search() | Chemical owner / site coordinator | Implemented |
sds_expiring | "SDS Expiring Soon" | "SDS for '{product_name}' expires in {days} days" | Scheduled check | Site coordinator | Planned |
Category: compliance (Compliance & Reporting)
| Type | Title Template | Message Template | Trigger Point | Recipients | Status |
|---|---|---|---|---|---|
compliance_gap_detected | "Compliance Gap Detected" | "{gap_count} compliance gaps found at {site_name}" | Compliance check service | Site coordinator + admins | Planned |
compliance_status_changed | "Compliance Status Changed" | "{site_name} compliance status changed to '{new_status}'" | Compliance update | Company admins | Planned |
audit_scheduled | "Audit Scheduled" | "Compliance audit scheduled for {site_name} on {date}" | Audit scheduling | Site coordinator | Planned |
quantity_threshold_exceeded | "Quantity Threshold Exceeded" | "Chemical '{chemical_name}' exceeded threshold at {site_name}" | Background: handle_quantity_recalculation() | Site coordinator | Planned |
Category: ai (AI-Generated Content)
| Type | Title Template | Message Template | Trigger Point | Recipients | Status |
|---|---|---|---|---|---|
ai_generation_started | "AI Generation Started" | "AI content generation started for plan '{plan_name}'" | Background: handle_hazcom_ai_generate() | Plan owner | Implemented |
ai_generation_completed | "AI Generation Complete" | "AI content generation completed for plan '{plan_name}'" | Background: handle_hazcom_ai_generate() | Plan owner | Implemented |
ai_generation_failed | "AI Generation Failed" | "AI content generation failed for plan '{plan_name}': {error}" | Background: handle_hazcom_ai_generate() | Plan owner | Implemented |
ai_prefill_completed | "AI Prefill Complete" | "AI questionnaire prefill completed for plan '{plan_name}'" | Background: handle_hazcom_ai_prefill() | Plan owner | Implemented |
Category: export (Document Export)
| Type | Title Template | Message Template | Trigger Point | Recipients | Status |
|---|---|---|---|---|---|
export_ready | "Export Ready" | "Your {export_type} export is ready for download" | Background: handle_report_generate() | Requesting user | Implemented |
export_failed | "Export Failed" | "Your {export_type} export failed: {error}" | Background: handle_report_generate() | Requesting user | Implemented |
Category: labels (EPA Labels)
| Type | Title Template | Message Template | Trigger Point | Recipients | Status |
|---|---|---|---|---|---|
label_found | "EPA Label Found" | "EPA label found for product '{product_name}'" | Background: handle_epa_label_search() | Requesting user | Implemented |
label_not_found | "EPA Label Not Found" | "No EPA label found for product '{product_name}'" | Background: handle_epa_label_search() | Requesting user | Implemented |
Training Notifications
Category: training (7 types)
Stored in the unified notifications table (merged from SafePath in Phase 1).
| Type | Title Template | Message Template | Trigger Point | Recipients | Dedup Window | Status |
|---|---|---|---|---|---|---|
training_assigned | "Training Assigned" | "You have been assigned '{course_title}'. Due: {due_date}" | Auto-assignment engine, manual assignment, background handlers | Assigned user | — | Implemented |
training_reminder | "Training Reminder" | "'{course_title}' is due in {days} days" | SafePathScheduler.send_training_reminders() | Assigned user | 72 hours | Implemented |
training_overdue | "Training Overdue" | "'{course_title}' is overdue by {days} days" | SafePathScheduler.check_overdue_assignments() | Assigned user | 24 hours | Implemented |
training_completed | "Training Completed" | "{user_name} completed '{course_title}'" | Course completion API | User's manager + admins | — | Implemented |
cert_expiring | "Certification Expiring" | "'{cert_name}' expires in {days} days" | SafePathScheduler.check_expiring_certifications() | Cert holder | 7 days | Implemented |
cert_expired | "Certification Expired" | "'{cert_name}' has expired" | Scheduler (past expiry date) | Cert holder | — | Implemented |
cert_renewed | "Certification Renewed" | "'{cert_name}' has been renewed, valid until {new_expiry}" | Cert renewal API | Cert holder | — | Implemented |
Email-Worthy Types
Added in Phase 2. These 15 types trigger email delivery via Mailgun when the notification is created. Users can opt out via
email_notifications_enabledon their profile.
| Category | Type | Email? | Urgency | Reason |
|---|---|---|---|---|
| workflow | plan_approved | Yes | Normal | Major event |
| workflow | plan_rejected | Yes | Warning | Requires action |
| workflow | plan_published | Yes | Normal | Major event |
| inventory | chemical_bulk_imported | Yes | Normal | User is waiting |
| inventory | sds_expiring | Yes | Warning | Action required |
| compliance | quantity_threshold_exceeded | Yes | Urgent | Safety-critical |
| compliance | plan_review_due | Yes | Warning | Action required |
| compliance | plan_overdue | Yes | Urgent | Overdue |
| ai | ai_generation_completed | Yes | Normal | User is waiting |
| ai | ai_generation_failed | Yes | Urgent | Action needed |
| training | training_assigned | Yes | Normal | Action required |
| training | training_reminder | Yes | Warning | Time-sensitive |
| training | training_overdue | Yes | Urgent | Safety compliance |
| training | cert_expiring | Yes | Warning | Time-sensitive |
| training | cert_expired | Yes | Urgent | Safety compliance |
Email styling by urgency:
- Urgent (red banner):
training_overdue,cert_expired,plan_overdue,ai_generation_failed,quantity_threshold_exceeded - Warning (amber banner):
training_reminder,cert_expiring,sds_expiring,plan_review_due,plan_rejected - Normal (blue banner): All other email-worthy types
Future Module Notifications
These are notification types planned for future modules (not yet implemented):
AdminHQ Module (Planned)
| Type | Description |
|---|---|
user_invited | New user invited to company |
user_accepted_invite | Invited user accepted and joined |
user_role_changed | User's role was modified |
subscription_expiring | Company subscription nearing renewal |
subscription_renewed | Subscription successfully renewed |
billing_payment_failed | Payment processing failed |
Incident Module (Future)
| Type | Description |
|---|---|
incident_reported | New incident report submitted |
incident_assigned | Incident investigation assigned |
incident_resolved | Incident marked as resolved |
near_miss_reported | Near-miss event reported |
Inspection Module (Future)
| Type | Description |
|---|---|
inspection_scheduled | Upcoming workplace inspection |
inspection_overdue | Inspection past due date |
inspection_completed | Inspection completed with findings |
corrective_action_required | Corrective action needed from inspection |
Emergency Response Module (Future)
| Type | Description |
|---|---|
drill_scheduled | Emergency drill scheduled |
drill_completed | Drill completed with results |
emergency_plan_updated | Emergency response plan updated |
Trigger Map
Complete mapping of notification type -> trigger point -> code location -> recipients.
General Notifications
| # | Type | Trigger Event | Code Location | Recipients | Channel |
|---|---|---|---|---|---|
| 1 | plan_created | Plan created via API | app/api/v1/hazcom/plans.py -> NotificationService.notify_plan_event() | Company users - actor | In-app + SSE |
| 2 | plan_published | Plan published | app/api/v1/hazcom/plans.py -> NotificationService.notify_plan_event() | Company users - actor | In-app + SSE + Email |
| 3 | plan_archived | Plan archived | app/api/v1/hazcom/plans.py -> NotificationService.notify_plan_event() | Company users - actor | In-app + SSE |
| 4 | plan_shared | Plan shared with user | Plan sharing API -> NotificationService.notify_user() | Specific users | In-app + SSE |
| 5 | section_completed | Plan section completed | Section update API -> NotificationService.notify_plan_event() | Plan collaborators | In-app + SSE |
| 6 | plan_approved | Plan approved in workflow | Approval API -> NotificationService.notify_plan_event() | Plan owner + reviewers | In-app + SSE + Email |
| 7 | plan_rejected | Plan rejected in workflow | Approval API -> NotificationService.notify_plan_event() | Plan owner | In-app + SSE + Email |
| 8 | plan_comment | Comment added to plan | Comment API -> NotificationService.notify_plan_event() | Collaborators - actor | In-app + SSE |
| 9 | plan_revision_requested | Revision requested | Review API -> NotificationService.notify_plan_event() | Plan owner | In-app + SSE |
| 10 | chemical_added | Chemical added to inventory | app/api/v1/chemiq/inventory.py | Site users | In-app + SSE |
| 11 | chemical_updated | Chemical updated | app/api/v1/chemiq/inventory.py | Site users | In-app + SSE |
| 12 | chemical_removed | Chemical removed | app/api/v1/chemiq/inventory.py | Site users | In-app + SSE |
| 13 | inventory_import_complete | Bulk import finished | Background: handle_bulk_import() | Import initiator | In-app (async) + Email |
| 14 | sds_attached | SDS auto-attached to product | Background: handle_sds_search() | Requesting user | In-app (async) |
| 15 | sds_expiring | SDS approaching 3-year expiry | Scheduled job (not implemented) | Site coordinator | Planned |
| 16-19 | compliance_* | Various compliance events | Not implemented | Various | Planned |
| 20 | ai_generation_started | AI content gen begins | Background handler | Plan owner | In-app (async) |
| 21 | ai_generation_completed | AI content gen succeeds | Background handler | Plan owner | In-app (async) + Email |
| 22 | ai_generation_failed | AI content gen fails | Background handler | Plan owner | In-app (async) + Email |
| 23 | ai_prefill_completed | AI questionnaire prefill done | Background handler | Plan owner | In-app (async) |
| 24 | export_ready | Report/export ready | Background handler | Requesting user | In-app (async) |
| 25 | export_failed | Report/export failed | Background handler | Requesting user | In-app (async) |
Training Notifications
| # | Type | Trigger Event | Code Location | Recipients | Channel |
|---|---|---|---|---|---|
| 1 | training_assigned | Manual or auto assignment | Assignment API / handle_safepath_rule_evaluate() / handle_safepath_plan_retraining() | Assigned user | In-app + Email |
| 2 | training_reminder | Due date approaching | SafePathScheduler.send_training_reminders() | Assigned user | In-app + Email |
| 3 | training_overdue | Past due date | SafePathScheduler.check_overdue_assignments() | Assigned user | In-app + Email |
| 4 | training_completed | User completes course | Course completion API | Manager + admins | In-app |
| 5 | cert_expiring | Cert approaching expiry | SafePathScheduler.check_expiring_certifications() | Cert holder | In-app + Email |
| 6 | cert_expired | Cert past expiry date | Scheduler (check after expiry) | Cert holder | In-app + Email |
| 7 | cert_renewed | Cert renewed/extended | Certification renewal API | Cert holder | In-app |
Settings Per Type
Global Email Toggle (Phase 2)
email_notifications_enabledoncore_data_userstable (default:true)- Controls all email delivery globally
- API:
GET/PUT /api/v1/notifications/email-preference
Per-Category Preferences (Tier 2 — Planned)
See Notification Preferences Plan for detailed implementation plan.
Background Service Settings
| Setting | Value | Description |
|---|---|---|
| Overdue dedup window | 24 hours | Don't re-notify overdue within this window |
| Reminder dedup window | 72 hours | Don't re-remind within this window |
| Cert alert dedup window | 7 days | Don't re-alert cert expiry within this window |
| Notification TTL | 90 days | When notifications auto-expire |