Add contact form backend with email notification via Resend API #17

Open
opened 2026-04-08 15:00:40 -04:00 by pook · 0 comments
Owner

Issue #10 requests a contact form endpoint. This is revenue-critical — visitors cannot currently submit inquiries.

Implementation

  1. Add POST /api/contact endpoint accepting JSON: name, email, phone, message
  2. Validate all fields server-side (email format, message length 10-2000 chars, phone optional)
  3. Send notification email to configured business address using Resend API
  4. Return 200 with confirmation message, 422 for validation errors, 500 for send failures
  5. Add rate limiting: max 5 submissions per IP per hour

Acceptance Criteria

  • POST /api/contact validates input and sends email notification
  • Invalid input returns 422 with field-level errors
  • Rate limiting prevents spam (5/hour per IP)
  • Environment variable RESEND_API_KEY and CONTACT_EMAIL are required
  • Unit tests cover validation and rate limiting logic

Generated by CEO Planner (priority: 3)

Issue #10 requests a contact form endpoint. This is revenue-critical — visitors cannot currently submit inquiries. ## Implementation 1. Add POST /api/contact endpoint accepting JSON: name, email, phone, message 2. Validate all fields server-side (email format, message length 10-2000 chars, phone optional) 3. Send notification email to configured business address using Resend API 4. Return 200 with confirmation message, 422 for validation errors, 500 for send failures 5. Add rate limiting: max 5 submissions per IP per hour ## Acceptance Criteria - POST /api/contact validates input and sends email notification - Invalid input returns 422 with field-level errors - Rate limiting prevents spam (5/hour per IP) - Environment variable RESEND_API_KEY and CONTACT_EMAIL are required - Unit tests cover validation and rate limiting logic --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/vision-tech-solutions#17
No description provided.