Appearance
IE.7: Assessment Emails and Notifications
Summary
Assessment assignment and completion events send email and in-app notifications. Assignments notify account clients and guest email recipients with a take-assessment link. Completion notifies the assigning counselor with a results link.
Role
- Primary: Counselor, Client, Guest
- Secondary: System, Resend
Entry Point
- Counselor assessment assignment UI
- Public assessment link:
/assessments/take/:token - Shared assessment landing:
/assessments/share/:token - Results page:
/assessments/:id/results
Preconditions
- Assessment exists and can be assigned/shared.
- Assignment identifies recipients by relationship/client or guest email.
- Email and notification services are optional but required for delivery.
Steps
- Counselor assigns an assessment to clients and/or guest emails.
- Backend creates assessment submissions with access tokens.
- Backend starts assignment notifications asynchronously.
- Backend resolves recipient email and recipient user ID from guest email or counselor-client relationship.
- Backend builds the take-assessment link using
/assessments/take/:accessToken. - Backend sends an in-app
assessment_assignednotification for account recipients. - Backend sends an
assessment_assignedemail to the recipient email when available. - When a submission is completed, backend starts completion notification work.
- Backend resolves the assigning counselor and respondent display name.
- Backend sends the counselor an in-app
assessment_completednotification and anassessment_completedemail. - Backend records notification sent timestamps on the submission where applicable.
Diagram
Edge Cases
- Guest recipient: Guests receive email only; no in-app notification exists without a user account.
- Missing client email: Assignment logs a warning and skips email when no email can be resolved.
- Email failure: Notification send failure is logged and does not fail the assignment/submission.
- Language preference: Account recipients use their language preference where available; guest recipients default to English.
- Completion without assigner: No completion notification is sent when
AssignedByis missing. - Expired submission: Public submission loading rejects expired submissions.
Current Implementation Notes
- Backend:
backend/internal/services/assessment_service.go - Frontend:
frontend/src/features/assessments/components/assign-assessment-dialog.tsx,frontend/src/features/assessments/pages/public-assessment.tsx,frontend/src/features/assessments/pages/shared-assessment-landing.tsx - Templates:
backend/scripts/seed_email_templates.sql,backend/scripts/seed_notification_templates.sql
Screenshot Status
- Not captured.