Manage inquiries from the expert-help page stored in Cloudflare D1
Manage inquiries from the expert-help page stored in Cloudflare D1. Query, update, and respond to contact form submissions with email integration.
/plugin marketplace add nprbst/speck-market/plugin install nprbst-speck-speck@nprbst/speck-marketManage interest inquiries submitted through the expert-help page contact form. This command queries and updates inquiries stored in Cloudflare D1.
Do NOT explore the codebase or check wrangler configuration. The management script at .claude/scripts/inquiries/manage.ts handles everything internally including directory navigation.
Start immediately with:
bun run .claude/scripts/inquiries/manage.ts stats
bun run .claude/scripts/inquiries/manage.ts list
Key points:
bun (not npm/npx) - this is a Bun projectwebsite/ for wrangler operations--remote flag for production database| Action | Command |
|---|---|
| List all new inquiries | /speck:inquiries list |
| Filter by status | /speck:inquiries list --status=contacted |
| View inquiry details | /speck:inquiries view 123 |
| Mark as contacted | /speck:inquiries mark-contacted 123 |
| Archive inquiry | /speck:inquiries archive 123 --notes="Handled" |
| View statistics | /speck:inquiries stats |
| Draft email response | /speck:inquiries respond 123 |
| Send email response | /speck:inquiries send 123 --subject="..." --body="..." |
Run the inquiry management script with the specified action:
bun run .claude/scripts/inquiries/manage.ts <action> [options]
list - Show recent inquiries (newest first)
# All inquiries
bun run .claude/scripts/inquiries/manage.ts list
# Filter by status
bun run .claude/scripts/inquiries/manage.ts list --status=new
bun run .claude/scripts/inquiries/manage.ts list --status=contacted
bun run .claude/scripts/inquiries/manage.ts list --status=archived
view - Show full details of a specific inquiry
bun run .claude/scripts/inquiries/manage.ts view <id>
mark-contacted - Update inquiry status to "contacted" and set timestamp
bun run .claude/scripts/inquiries/manage.ts mark-contacted <id>
archive - Archive an inquiry with optional notes
bun run .claude/scripts/inquiries/manage.ts archive <id>
bun run .claude/scripts/inquiries/manage.ts archive <id> --notes="Handled via email on 2025-01-15"
stats - Show inquiry statistics by status
bun run .claude/scripts/inquiries/manage.ts stats
respond - Fetch inquiry details for drafting an email response
bun run .claude/scripts/inquiries/manage.ts respond <id>
This outputs the inquiry details formatted for Claude to draft a response, including the original message and a template to fill in.
send - Send an email response via Resend API and record in database
# Via --body flag
bun run .claude/scripts/inquiries/manage.ts send <id> --subject="Re: Your Speck Inquiry" --body="Your markdown response..."
# Via stdin (heredoc) - preferred for multi-line content
bun run .claude/scripts/inquiries/manage.ts send <id> --subject="Re: Your Speck Inquiry" <<'EOF'
Your **markdown** response here.
- Supports full markdown
- Multi-line content
- Code blocks, etc.
EOF
# Preview HTML without sending (no RESEND_API_KEY required)
bun run .claude/scripts/inquiries/manage.ts send <id> --subject="..." --preview <<'EOF'
Preview content...
EOF
This command:
--preview)responses tableBy default, the script queries the local D1 database (development).
To query the remote (production) database, add the --remote flag:
bun run .claude/scripts/inquiries/manage.ts list --remote
bun run .claude/scripts/inquiries/manage.ts view 123 --remote
| Status | Description | Emoji |
|---|---|---|
new | Unread inquiry, needs attention | 🆕 |
contacted | Admin has reached out to the inquirer | 📧 |
archived | Handled or no longer active | 📁 |
Check for new inquiries:
bun run .claude/scripts/inquiries/manage.ts list --status=new --remote
Review an inquiry:
bun run .claude/scripts/inquiries/manage.ts view 42 --remote
After responding via email, mark as contacted:
bun run .claude/scripts/inquiries/manage.ts mark-contacted 42 --remote
If no follow-up needed, archive:
bun run .claude/scripts/inquiries/manage.ts archive 42 --notes="Scheduled call for next week" --remote
Review a new inquiry and prepare to respond:
bun run .claude/scripts/inquiries/manage.ts respond 42 --remote
Ask Claude to draft a response based on the inquiry content
Send the email (Claude drafts the markdown body):
bun run .claude/scripts/inquiries/manage.ts send 42 \
--subject="Re: Your Speck Inquiry" \
--body="Thank you for your interest in Speck!
I'd be happy to discuss implementation support for your team.
**Next Steps:**
- Schedule a 30-minute discovery call
- Review your current development workflow
Best regards,
The Speck Team" --remote
The email is sent, recorded in the database, and the inquiry is marked as contacted
bunx wrangler (not npx). Authenticate with bunx wrangler loginspeck-inquiries database must exist (created via bunx wrangler d1 create)cd website && bunx wrangler d1 migrations apply speck-inquiries --local firstsend command. Set via export RESEND_API_KEY=re_xxxxx"no such table: inquiries"
cd website && bunx wrangler d1 migrations apply speck-inquiries --local"no such table: responses"
cd website && bunx wrangler d1 migrations apply speck-inquiries --local"authentication required"
bunx wrangler login to authenticate with Cloudflare"RESEND_API_KEY environment variable is not set"
export RESEND_API_KEY=re_xxxxxEmail send fails with "domain not verified"
hello@speck.codesEmpty results