Form Submission Webhook
Component Detail
Description
A Next.js API route or Vercel serverless edge function that receives the validated booking form POST, forwards the payload to a configured email inbox or third-party webhook handler (e.g. Formspree, Netlify Forms, or a simple email relay), and returns a redirect to /booking/confirmation on success. No write to the operational database occurs; the Sales Website remains fully decoupled from the operational backend.
form-submission-webhook
Sources & reasoning
The webhook handler is the sole backend component of the Booking Form feature. It keeps the Sales Website statically exported while providing an actionable inbound path for leads, directly fulfilling the primary conversion mechanism purpose described in the feature.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Receive HTTP POST with booking form payload from the static site
- Forward validated payload to configured email or webhook destination
- Return redirect to booking confirmation page on success
- Return structured error response on delivery failure
- Apply rate-limiting to prevent abuse of the public endpoint
Interfaces
POST /api/book-demo
forward(payload: BookingPayload, destination: string): Promise<ForwardResult>
rateLimit(ip: string): boolean