Add contact form inbox to admin portal; v2.0.25
- New Inbox view in the Audience nav group shows all contact form submissions - Filter by Unread / All / Archived with a search bar for name, email, or message - Click any message to open a detail pane with full text, metadata, and a Reply via Email link - Archive / Unarchive button to clear messages without deleting them - Unread badge on the Inbox nav item; dashboard card now links directly to Inbox - Added PATCH /api/admin-contact-submissions/:id to persist archived state Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8ff01f8e48
commit
590885f6b1
3 files changed
+162
-1
No files matched your search
@@ -358,6 +358,21 @@ export function register(app) {
|
||||
res.json({ submissions: state.contactSubmissions.slice(0, 300) })
|
||||
})
|
||||
|
||||
app.patch('/api/admin-contact-submissions/:id', requireAdminAuth, (req, res) => {
|
||||
const { id } = req.params
|
||||
const { archived } = req.body ?? {}
|
||||
if (typeof archived !== 'boolean') {
|
||||
res.status(400).json({ message: 'archived must be a boolean.' }); return
|
||||
}
|
||||
const idx = state.contactSubmissions.findIndex(s => s.id === id)
|
||||
if (idx === -1) {
|
||||
res.status(404).json({ message: 'Submission not found.' }); return
|
||||
}
|
||||
state.contactSubmissions[idx] = { ...state.contactSubmissions[idx], archived }
|
||||
queueContactSubmissionsWrite()
|
||||
res.json({ ok: true, submission: state.contactSubmissions[idx] })
|
||||
})
|
||||
|
||||
app.get('/api/admin-subscribers', requireAdminAuth, (_req, res) => {
|
||||
const seen = new Set()
|
||||
const subscribers = state.contactSubmissions
|
||||
|
||||
Reference in new issue
Block a user