Documentation Index
Fetch the complete documentation index at: https://grantmaster.dev/llms.txt
Use this file to discover all available pages before exploring further.
Engineering reference: For service contracts, EventBus events, and data-layer details see src/features/email/email.md.
Overview
Theemail feature provides an admin-facing email operations panel for monitoring and managing the organization’s transactional email system, which is powered by Postmark. It allows admins to view delivery statistics, browse email activity, manage bounced addresses, inspect templates, and send test emails.
This feature is an operations tool, not a user-facing notification center. It surfaces Postmark’s server-level data through a unified UI.
Entry point: EmailManagement component (admin settings area)
Data Model
Firestore Collections
None. All data is fetched live from the Postmark API viashared/email/postmarkAdminService.
Key TypeScript Types
Key Behaviors
Stats Overview
On load,useEmailManagementState fetches three data sources in parallel: getEmailStats(), getEmailActivity(), getBounces(). Stats are displayed in EmailStatsCards (sent, delivered, bounce rate, open rate).
Activity Feed
ActivityTab displays the full email activity log. Users can search by recipient email (handleSearch → searchEmailByRecipient()). Results replace the activity list while the search query is active; clearing the query reloads the full activity list.
Bounce Management
SuppressionTab shows bounced addresses fetched from Postmark’s suppression list. Admins can reactivate a bounced address via handleActivateBounce() → activateBounce(email), which removes the address from Postmark’s suppression list and triggers a data refresh.
Template Management
TemplatesTab lists Postmark email templates available on the server. Admins can send a test email to a specified address using a selected template via handleSendTest(email, template) → sendTestEmail(email, template).
Error Handling
All API calls are wrapped with Sentry error capture. Errors display as toast notifications and set a visibleerror state in the UI.
Service Contract
All Postmark API calls are made throughshared/email/postmarkAdminService — this feature does not own a service file directly.
| Hook | Owns | Key interface |
|---|---|---|
useEmailManagementState | All email management state | stats, activity, bounces, handleSearch, handleSendTest, handleActivateBounce, handleRefresh |
| Shared service | Location | Methods used |
|---|---|---|
postmarkAdminService | src/shared/email/ | getEmailStats, getEmailActivity, getBounces, searchEmailByRecipient, sendTestEmail, activateBounce |
Events
Emitted
None. Email management operations are administrative; no EventBus events are emitted.Consumed
None.Dependencies
Depends on:shared/email/postmarkAdminService— Postmark API integration- Sentry (
@sentry/react) — error capture sonner— toast notifications
- Settings / admin area —
EmailManagementis surfaced as an admin panel tab