Issue 302
Contact form: optional blank email drops the owner email; browser and server check addresses differently
Back to our planOpen
bugfrontendcmspriority: low
Follow-up from the independent review of #298 (two minor findings, neither blocking).
Problem
- A form with an optional email field that's left blank sends the owner nothing.
- The message is still stored, but
toEmailDeliveryanswersdrop. - A form with no email field at all still sends at once, so the two cases differ for messages that are equally anonymous.
- Production doesn't change today: the seeded contact form's email field is required.
- The message is still stored, but
- The browser accepts addresses the server refuses (for example
ana@gmail).- The visitor sees success, but no confirmation link is sent and the owner email is dropped.
- Before #298, such a message still reached the owner.
Proposed fix
- Drop only when the form's email field is required. A blank optional field then sends like a form without one, which still closes the hand-built bypass on the contact form.
- Use the server's email check in the browser, so the form asks the visitor to fix the address.
Acceptance criteria
- Not done: An optional email field left blank sends the owner email; a required one with no valid address still drops
- Not done: An address the server would refuse shows an error in the form before sending
- Not done: Tests for both
Generated by Claude Code, opens in a new tab