Champion Portal Development Phase 4
Estimated Effort: 4–6 weeks
Focus: Direct Messaging, NotificationsPrerequisites: Phase 1–3 complete
Related Documents:
- ../README.md — Champion Portal overview
- ../features/06-MESSAGING.md — Messaging spec
- ../development/DECISIONS.md — Messaging architecture decision
Phase 4 introduces direct messaging between Champions and a notification system for portal activity. This enables Champions to connect privately without sharing personal contact information.
Architecture Decision: Per DECISIONS.md, Phase 4 starts with email relay messaging, with in-app messaging added if demand warrants.
After Phase 4, Champions can:
Phase 4 is divided into 3 sub-phases that can be implemented incrementally.
| Sub-Phase | Name | Prompt | Est. Time |
|---|---|---|---|
| 4.1 | Email Relay Messaging | “Implement Phase 4.1” | 2–3 days |
| 4.2 | Notification System | “Implement Phase 4.2” | 2–3 days |
| 4.3 | In-App Messaging (Optional) | “Implement Phase 4.3” | 3–4 days |
Goal: Champions can contact each other through a portal form; messages delivered via email.
Deliverables:
Cp::MessageRequest table (sender_id, recipient_id, subject, body, sent_at)Acceptance Test:
Goal: Champions receive notifications for relevant portal activity.
Deliverables:
cp_notifications table (recipient_id, type, data, read_at, created_at)Cp::Notification model with types enumNotification Types:
| Type | Trigger | Email? |
|---|---|---|
comment_on_post |
Someone comments on your post | Optional |
mention |
@mentioned in post or comment | Yes |
event_approved |
Your event was approved | Yes |
event_rejected |
Your event was rejected | Yes |
message_received |
Someone messaged you | Yes |
story_featured |
Your story was featured | Yes |
Acceptance Test:
Goal: Full in-app messaging system (if demand from Phase 4.1 warrants).
Note: This sub-phase is optional. Only implement if email relay shows high usage and users request in-app messaging.
Deliverables:
cp_messages table (thread_id, sender_id, content, created_at)cp_message_threads table (participants, created_at, updated_at)Acceptance Test:
| Question | Decision | Source |
|---|---|---|
| Messaging architecture | Email relay first, in-app later if demand | DECISIONS.md §2.4 |
| Question | Options | Notes |
|---|---|---|
| Message retention policy | A) Forever B) 2 years C) 1 year D) User-controlled | Storage and privacy |
| Group messaging? | A) 1:1 only B) Groups allowed | Complexity |
| Read receipts? | A) Always B) Optional C) Never | Privacy vs UX |
| Reply-to consent | A) Always include B) Opt-in C) Never | Privacy |
| Notification email frequency | A) Immediate B) Batched daily C) User preference | Email volume |
| Question | Who Decides | Impact |
|---|---|---|
| Acceptable use policy for messaging | Legal/Engagement | Terms of service |
| Spam/abuse reporting process | Engagement Team | Moderation workflow |
| Email template branding | Marketing | Email design |
| Area | Deliverables |
|---|---|
| Email Relay | Contact form, email delivery, sent history |
| Notifications | In-app notifications, email notifications, preferences |
| In-App Messaging (Optional) | Inbox, threads, real-time (if warranted) |
| Feature | Notes |
|---|---|
| File attachments in messages | Future consideration |
| Voice/video calling | Not planned |
| Scheduling/calendar integration | Separate feature |
| Criterion | Validation |
|---|---|
| Champion can send contact message | Email delivered to recipient |
| Sender sees message in history | Sent messages page works |
| Recipient receives email | Email arrives with content |
| Notifications appear | Bell icon shows count, dropdown works |
| Notification preferences work | User can adjust settings |
| Notifications marked read | Count decreases, visual indicator changes |
| Metric | Target |
|---|---|
| Messages sent per week (pilot) | 10+ |
| Message response rate | 50%+ |
| Notification click-through rate | 30%+ |
| Model | Test Cases |
|---|---|
Cp::MessageRequest |
Validations, rate limiting scope, associations |
Cp::Notification |
Validations, types enum, read/unread scopes |
| Controller | Test Cases |
|---|---|
Cp::MessagesController |
Send message, rate limit, view sent |
Cp::NotificationsController |
List, mark read, mark all read |
| Feature | Test Cases |
|---|---|
| Contact flow | Click contact → fill form → email sent → appears in history |
| Notification flow | Action triggers → notification created → displayed → marked read |
| Test Cases | |
|---|---|
| Message relay | Correct recipient, subject, body, reply-to |
| Notification emails | Event approved, mentioned, etc. |
After completing Phase 4, update:
| Document | Changes |
|---|---|
| ../README.md | Mark Phase 4 complete |
| ../development/DECISIONS.md | Record any messaging decisions |
| Champion User Guide | Add messaging and notifications sections |
| Privacy Policy | Update with messaging data retention |