Commit e185035
committed
fix: send subscribe form as urlencoded so Customer.io records form_submit
The whats-new subscribe form posts to Customer.io's submit_action endpoint,
which expects application/x-www-form-urlencoded (the encoding native HTML
form POSTs use). Commit 6cce858 replaced the native submit with a fetch()
that sent FormData (multipart/form-data); the endpoint accepts the request
and returns the 302, but does not record a form_submit event, so no one is
added to the subscriber segment. The opaqueredirect response made the UI
report success regardless.
Switch the body to URLSearchParams so the request matches the encoding the
endpoint actually processes. Add regression tests pinning the body type.1 parent 38945b8 commit e185035
2 files changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
166 | | - | |
| 169 | + | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| |||
0 commit comments