Skip to content

Add inbound emails view to mailers page#2

Open
mgodwin wants to merge 2 commits into
mainfrom
claude/add-inbound-emails-view-TTWQP
Open

Add inbound emails view to mailers page#2
mgodwin wants to merge 2 commits into
mainfrom
claude/add-inbound-emails-view-TTWQP

Conversation

@mgodwin

@mgodwin mgodwin commented Jan 11, 2026

Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits January 6, 2026 15:13
This commit adds comprehensive support for tracking and viewing inbound emails
alongside outbound emails on the mailers page.

Changes:
- Add `direction` field to MailDelivery model to distinguish between 'outbound' and 'inbound' emails
- Create ActionMailboxSubscriber to capture inbound emails via ActionMailbox events
- Update ActionMailerSubscriber to set direction='outbound' for sent emails
- Split mailers UI into separate "Outbound Deliveries" and "Inbound Deliveries" sections
- Add "Emails Received" metric to summary panel alongside "Emails Sent"
- Update controller to filter deliveries by direction parameter
- Configure ActionMailbox in test dummy app with test/relay ingress
- Create ApplicationMailbox and CatchAllMailbox for handling inbound emails
- Add ActionMailbox database migration for inbound_emails and active_storage tables
- Create seed task to generate sample inbound and outbound emails for testing
- Add comprehensive tests for inbound email capture and UI rendering
- Update existing tests to reflect new dual-table UI structure

The implementation allows users to view both sent and received emails separately,
with metrics tracked independently for each direction.
Update the observatory:seed rake task to periodically generate inbound emails
alongside existing outbound emails, requests, and jobs.

Changes:
- Add inbound email scenarios with variety of subjects (support, inquiries, feedback, etc.)
- Update event distribution: 50% requests, 30% jobs, 10% outbound mail, 10% inbound mail
- Generate realistic inbound emails using ActionMailbox::InboundEmail API
- Each inbound email includes random sender, subject, and message content

Usage: bin/rails observatory:seed

This allows continuous testing and visualization of both inbound and outbound
email tracking in the mailers dashboard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants