Task 2: Email Notification Integration (smtp4dev)
Prerequisites
- smtp4dev running locally at
http://localhost:5000 .envconfigured withNOTIFICATIONS_EMAIL_ENABLED=true
Test Cases
| ID | Scenario | Expected Result | Status |
|---|---|---|---|
| T2-01 | NOTIFICATIONS_EMAIL_ENABLED=true + SMTP configured | Email is sent for email-enabled events | |
| T2-02 | NOTIFICATIONS_EMAIL_ENABLED=false | No email sent; internal notifications still work | |
| T2-03 | Trigger each supported event | Email recipient matches intended role/user mapping | |
| T2-04 | SMTP available in smtp4dev | Email visible in smtp4dev inbox | |
| T2-05 | SMTP failure/unavailable | Primary API action still completes; no workflow crash |
Demo Walkthrough
- Open smtp4dev at
http://localhost:5000→ Show empty inbox - Trigger an event (e.g., submit KPI self-assessment) → Show email appears in smtp4dev
- Click the email → Show the content and recipient are correct
- Set
NOTIFICATIONS_EMAIL_ENABLED=false→ Trigger another event → Show no new email but internal notification still created