How marclou/mailcheap works
Mailcheap is a self-hosted newsletter application. An administrator creates an issue, chooses an audience and send options, then the application sends it through Amazon SES, processes delivery events and engagement, and publishes issues to a public archive. Separate branches cover subscriber acquisition and list health, campaign and audience management, analytics, and archive publishing. The README documents major product capabilities; source excerpts and the SOURCE INDEX provide additional implementation evidence. Some route implementations were not sampled, so those connections are documented rather than inferred from names alone.
Main entry points: Campaign.js Campaign records · Contact.js Contact records · actions.js Campaign editor · archive-data.js Archive data
Components 24
Campaign management
- Campaign editor
app/(app)/campaigns/actions.js - Newsletter settings
app/(app)/newsletters/actions.js - Campaign records
models/Campaign.js
Audience and signup
- Contact management
app/(app)/contacts/page.js - Signup API
app/api/v1/contacts/route.js - Contact records
models/Contact.js - Opt-in confirmation
app/confirm/actions.js - Unsubscribe handling
app/api/unsubscribe/route.js
Sending and delivery
- Send checks
lib/sending-rules.js - Batch sending
lib/sending.js - Scheduled sends
lib/scheduling.js - Background job routes
app/api/jobs/send-batch/route.js - Amazon SES
- SES event webhook
app/api/webhooks/ses/route.js
Tracking and reports
- Event processing
lib/ses-events.js - Open and click tracking
lib/tracking.js - Overview analytics
app/(app)/(overview)/page.js - Campaign reports
components/CampaignReport.jsx
Public archive
- Archive data
lib/archive-data.js - Public archive
app/archive/[slug]/page.js - Issue page
app/archive/[slug]/p/[post]/page.js
Other components
- Administrator
- MongoDB
- QStash
Connections 27
- Administrator → Campaign editor: edits and sends
- Campaign editor → Campaign records: creates and updates
app/(app)/campaigns/actions.js - Campaign editor → Send checks: checks before send
app/(app)/campaigns/actions.js - Campaign editor → Batch sending: starts sending
app/(app)/campaigns/actions.js - Newsletter settings → Contact management: configures audience
- Contact management → Contact records: manages contacts
- Signup API → Contact records: adds subscribers
- Signup API → Opt-in confirmation: supports opt-in
- Unsubscribe handling → Contact records: updates status
app/api/unsubscribe/route.js - Unsubscribe handling → Campaign records: credits unsubscribe
app/api/unsubscribe/route.js - Background job routes → Batch sending: runs batches
app/api/jobs/send-batch/route.js - Background job routes → Scheduled sends: runs schedules
- Scheduled sends → QStash: queues work
- Batch sending → Amazon SES: sends email
lib/sending.js - Amazon SES → SES event webhook: posts events
- SES event webhook → Event processing: dispatches events
app/api/webhooks/ses/route.js - Event processing → Contact records: updates engagement
lib/ses-events.js - Event processing → Campaign records: updates statistics
lib/ses-events.js - Open and click tracking → Campaign records: records views
- Overview analytics → Campaign records: shows send metrics
- Campaign reports → Campaign records: reports campaign results
- Public archive → Archive data: loads archive
- Issue page → Archive data: loads issue
- Archive data → Campaign records: reads published issues
lib/archive-data.js - Archive data → Contact records: counts readers
lib/archive-data.js - Campaign records → MongoDB: persists in
- Contact records → MongoDB: persists in