Add optional message field to /submit for iOS review intercept
- /submit now requires email OR message (email-only calls unchanged) - message trimmed + capped at 10k chars; stored via guarded ALTER TABLE migration - /export CSV gains message column with proper quoting/escaping - test suite (node --test): 9 tests covering compat, validation, truncation, CSV escaping Ticket: T2 of review-flow-10x epic (chatai-ios#136) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WPnLnXS4YRz9vVt1BEdeR
This commit is contained in:
co-authored by
Claude Fable 5
parent
f30ed614e4
commit
e73b4f7e34
@@ -31,12 +31,15 @@ POST /submit
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"email": "user@example.com",
|
||||
"form_name": "newsletter", # optional, default: "default"
|
||||
"source": "homepage" # optional
|
||||
"email": "user@example.com", # optional if message present
|
||||
"form_name": "newsletter", # optional, default: "default"
|
||||
"source": "homepage", # optional
|
||||
"message": "free-text..." # optional, max 10k chars; required if email absent
|
||||
}
|
||||
```
|
||||
|
||||
Either `email` or `message` is required. Message-only submissions (e.g. `form_name: "review_intercept"` from the iOS negative-review intercept) store an empty email.
|
||||
|
||||
### List Submissions (protected)
|
||||
```bash
|
||||
GET /emails?form_name=newsletter&limit=100&offset=0
|
||||
|
||||
Reference in New Issue
Block a user