Test Cases: Event Email Settings
Module: Events & Registrations - Email Settings
Backend Endpoints:
GET /api/admin/events/:eventId/email-settingsPUT /api/admin/events/:eventId/email-settingsDELETE /api/admin/events/:eventId/email-settings
Frontend Page: Admin Event Email Settings (part of Event Management)
Priority: P2
Phase: 2
Prerequisites
- User is Admin or Event Manager.
- At least one event exists in any status (DRAFT, PUBLISHED, CANCELLED).
- Email service is configured and operational.
Test Cases
TC-EMAIL-01: Get Event Email Settings (Default)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to Event Detail in Admin. | Event management page displayed. |
| 2 | Access "Email Settings" section/tab. | API Request GET /api/admin/events/:eventId/email-settings. |
| 3 | Check Response (No Custom Settings). | Default settings returned or empty object indicating defaults apply. |
| 4 | Verify UI. | Form fields show empty/default values for customMessage, instructions. Toggles for includeCalendar and includeQrCode show default state. |
TC-EMAIL-02: Get Event Email Settings (Custom Configured)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Find event with previously saved email settings. | - |
| 2 | Navigate to Email Settings. | API Request GET /api/admin/events/:eventId/email-settings. |
| 3 | Check Response. | Returns saved settings: customMessage, instructions, includeCalendar, includeQrCode. |
| 4 | Verify UI. | Form fields populated with saved values. Toggles reflect saved boolean states. |
TC-EMAIL-03: Update Email Settings - Custom Message
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings for an event. | Settings form displayed. |
| 2 | Enter customMessage: "Welcome to our special event! Please arrive 15 minutes early." | - |
| 3 | Save Settings. | API Request PUT /api/admin/events/:eventId/email-settings with body containing customMessage. |
| 4 | Check API Response. | Status 200 OK. Updated settings returned. |
| 5 | Verify Persistence. | Refresh page. Custom message still displayed. |
TC-EMAIL-04: Update Email Settings - Instructions
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings for an event. | Settings form displayed. |
| 2 | Enter instructions: "Dress code: Business casual. Parking available in Lot B." | - |
| 3 | Save Settings. | API Request PUT /api/admin/events/:eventId/email-settings with body containing instructions. |
| 4 | Check API Response. | Status 200 OK. Updated settings returned. |
| 5 | Verify Persistence. | Refresh page. Instructions still displayed. |
TC-EMAIL-05: Update Email Settings - Combined Fields
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings for an event. | Settings form displayed. |
| 2 | Enter both customMessage and instructions. | - |
| 3 | Set includeCalendar: true and includeQrCode: true. | - |
| 4 | Save Settings. | API Request PUT /api/admin/events/:eventId/email-settings with full payload. |
| 5 | Check API Response. | Status 200 OK. All fields returned correctly. |
| 6 | Verify Persistence. | Refresh page. All settings retained. |
TC-EMAIL-06: Toggle Calendar Attachment - Enable
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings for an event. | Settings form displayed. |
| 2 | Enable includeCalendar toggle. | Toggle switches to ON state. |
| 3 | Save Settings. | API Request PUT /api/admin/events/:eventId/email-settings with includeCalendar: true. |
| 4 | Check API Response. | Status 200 OK. includeCalendar is true. |
| 5 | Verify Future Emails. | Registration confirmation emails include .ics calendar attachment. |
TC-EMAIL-07: Toggle Calendar Attachment - Disable
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings for event with includeCalendar: true. | Toggle shows ON state. |
| 2 | Disable includeCalendar toggle. | Toggle switches to OFF state. |
| 3 | Save Settings. | API Request PUT /api/admin/events/:eventId/email-settings with includeCalendar: false. |
| 4 | Check API Response. | Status 200 OK. includeCalendar is false. |
| 5 | Verify Future Emails. | Registration confirmation emails do NOT include calendar attachment. |
TC-EMAIL-08: Toggle QR Code Inclusion - Enable
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings for an event. | Settings form displayed. |
| 2 | Enable includeQrCode toggle. | Toggle switches to ON state. |
| 3 | Save Settings. | API Request PUT /api/admin/events/:eventId/email-settings with includeQrCode: true. |
| 4 | Check API Response. | Status 200 OK. includeQrCode is true. |
| 5 | Verify Future Emails. | Registration confirmation emails include QR code image for check-in. |
TC-EMAIL-09: Toggle QR Code Inclusion - Disable
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings for event with includeQrCode: true. | Toggle shows ON state. |
| 2 | Disable includeQrCode toggle. | Toggle switches to OFF state. |
| 3 | Save Settings. | API Request PUT /api/admin/events/:eventId/email-settings with includeQrCode: false. |
| 4 | Check API Response. | Status 200 OK. includeQrCode is false. |
| 5 | Verify Future Emails. | Registration confirmation emails do NOT include QR code image. |
TC-EMAIL-10: Delete/Reset Email Settings
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings for event with custom settings. | Custom settings displayed. |
| 2 | Click "Reset to Defaults" or "Delete Custom Settings". | Confirmation prompt displayed. |
| 3 | Confirm Action. | API Request DELETE /api/admin/events/:eventId/email-settings. |
| 4 | Check API Response. | Status 200 OK or 204 No Content. |
| 5 | Verify UI. | Settings form reverts to default/empty state. |
| 6 | Verify Persistence. | Refresh page. Default settings shown. |
TC-EMAIL-11: Email Preview with Custom Settings
| Step | Action | Expected Result |
|---|---|---|
| 1 | Configure custom email settings (message, instructions, calendar, QR). | Settings saved. |
| 2 | Click "Preview Email" button. | Email preview modal/page displayed. |
| 3 | Verify Preview Content. | Preview shows: custom message, instructions, event details. |
| 4 | Verify Calendar Indicator. | If includeCalendar: true, preview indicates ".ics attachment will be included". |
| 5 | Verify QR Code. | If includeQrCode: true, sample QR code displayed in preview. |
TC-EMAIL-12: Email Preview with Default Settings
| Step | Action | Expected Result |
|---|---|---|
| 1 | Ensure event has no custom email settings (or reset them). | Default settings apply. |
| 2 | Click "Preview Email" button. | Email preview modal/page displayed. |
| 3 | Verify Preview Content. | Preview shows standard template without custom message/instructions. |
| 4 | Verify Default Behavior. | Calendar and QR code indicators show based on system defaults. |
TC-EMAIL-13: Authorization - Admin Access
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as Admin user. | - |
| 2 | Navigate to Event Email Settings. | Settings page accessible. |
| 3 | Modify and Save Settings. | Changes saved successfully. |
| 4 | Delete Settings. | Deletion allowed. |
TC-EMAIL-14: Authorization - Event Manager Access
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as Event Manager user. | - |
| 2 | Navigate to Event Email Settings. | Settings page accessible. |
| 3 | Modify and Save Settings. | Changes saved successfully. |
| 4 | Delete Settings. | Deletion allowed. |
TC-EMAIL-15: Authorization - Unauthorized User
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as regular Member (no Admin/Event Manager role). | - |
| 2 | Attempt to access Email Settings via direct URL. | Access denied. Redirect to dashboard or 403 error. |
| 3 | Attempt API call via Postman. | API Response: 401 Unauthorized or 403 Forbidden. |
TC-EMAIL-16: Validation - Empty Custom Message
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings. | Settings form displayed. |
| 2 | Clear customMessage field (if previously set). | Field empty. |
| 3 | Save Settings. | Request successful. Empty string or null accepted. |
| 4 | Verify Email Output. | Confirmation emails use default template without custom message section. |
TC-EMAIL-17: Validation - Long Custom Message
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings. | Settings form displayed. |
| 2 | Enter very long customMessage (e.g., 5000+ characters). | - |
| 3 | Save Settings. | Either: (a) Validation error if limit exceeded, or (b) Success if within limits. |
| 4 | Verify Behavior. | UI should indicate character limit if applicable. API should validate. |
TC-EMAIL-18: Validation - Special Characters in Instructions
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings. | Settings form displayed. |
| 2 | Enter instructions with special characters: , HTML tags, emojis, unicode. | - |
| 3 | Save Settings. | Request processed. |
| 4 | Verify Sanitization. | HTML/script tags sanitized or escaped. Safe characters preserved. |
| 5 | Verify Email Output. | Instructions render correctly without XSS vulnerability. |
TC-EMAIL-19: Settings Persistence Across Event Status Changes
| Step | Action | Expected Result |
|---|---|---|
| 1 | Configure email settings for DRAFT event. | Settings saved. |
| 2 | Publish the event. | Event status changes to PUBLISHED. |
| 3 | Verify Email Settings. | Settings remain intact after status change. |
| 4 | Cancel the event. | Event status changes to CANCELLED. |
| 5 | Verify Email Settings. | Settings remain intact (though may not be used for cancelled event). |
TC-EMAIL-20: Email Delivery with Custom Settings
| Step | Action | Expected Result |
|---|---|---|
| 1 | Configure email settings: custom message, instructions, calendar ON, QR ON. | Settings saved. |
| 2 | Register a member for the event. | Registration successful. |
| 3 | Check Member's Email Inbox. | Confirmation email received. |
| 4 | Verify Email Content. | Custom message present. Instructions present. Calendar attachment included. QR code image included. |
| 5 | Verify Calendar File. | .ics file opens correctly in calendar apps with event details. |
| 6 | Verify QR Code. | QR code is scannable and contains valid ticket code. |
Edge Cases
TC-EMAIL-21: Settings for Non-Existent Event
| Step | Action | Expected Result |
|---|---|---|
| 1 | Attempt API call GET /api/admin/events/{invalid-id}/email-settings. | - |
| 2 | Check Response. | Status 404 Not Found. Error message "Event not found". |
TC-EMAIL-22: Concurrent Settings Update
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open Email Settings in two browser tabs. | Both show current settings. |
| 2 | Make different changes in each tab. Save Tab 1 first. | Tab 1 saves successfully. |
| 3 | Save Tab 2. | Either: (a) Overwrites Tab 1 changes, or (b) Conflict error with stale data message. |
| 4 | Verify Final State. | Settings reflect most recent save (or appropriate conflict resolution). |
TC-EMAIL-23: Settings Update During Active Registrations
| Step | Action | Expected Result |
|---|---|---|
| 1 | Event has existing registrations. | - |
| 2 | Update email settings. | Settings saved. |
| 3 | New registration occurs. | New confirmation email uses updated settings. |
| 4 | Previous registrations. | Previous registrations are NOT affected (no retroactive email changes). |