# Form handling and reconnection notes

> The form is not the lock-in mechanism. A static exported site
> must remain useful even if the form is replaced or disabled.
> Phone and email contact options can remain visible on the
> Contact page.

## Current state (from SITE_CONFIG.json)

- Form enabled: `true`
- Form fields: `[
  "name",
  "email",
  "phone",
  "message"
]`
- Handler type: `cloudflare_awf_endpoint`
- Public endpoint reference: `https://awf-form-endpoint.jesseghostley.workers.dev/submit`
- Reconnection required: `true`
- External hosting supported: `true`
- Export notes: This site's contact form posts JSON to the AWF Cloudflare form endpoint at https://awf-form-endpoint.jesseghostley.workers.dev/submit (contract: POST /submit, form_type=contact). To leave AWF hosting, replace the endpoint: (1) point the form at a customer-owned form service and map the same fields; (2) swap the form for a mailto: link using the business email; (3) post to your own backend that accepts {name,email,phone,message}. Only this one change is required.

## Why this file exists

If the site uses an AWF/Cloudflare form endpoint, the export must
include clear instructions to replace or reconnect the form
outside AWF. This file is that instruction set.

## Phone / email fallback

The Contact page must always show phone and email contact options
even if the form handler is `not_configured`, `mailto`, or
`external`. Phone and email are sourced from
`SITE_CONFIG.json.business.phone` and
`SITE_CONFIG.json.business.email`.

## External hosting reconnection

If the site is hosted outside AWF:

1. Confirm the form's `handler.type` in `SITE_CONFIG.json`. If it
   is `cloudflare_awf_endpoint`, the endpoint may not work after
   the move unless reconnected or replaced.
2. Choose a replacement handler:
   - `mailto:` link to the public email
   - a customer-owned form provider
   - a static-site-compatible form service
3. Update the Contact page's `<form action="...">` to the new
   endpoint, or replace the form with a `mailto:` link.
4. Re-run the export or re-render the page after updating the
   config.

## Suggested replacements

- `mailto:` link with the public email pre-filled in the subject
  and body.
- Customer-owned form provider (e.g. Formspree, Basin, Getform).
- Static-site-compatible form service that posts to the
  customer's endpoint.
- Native contact page with phone and email only (no form).

## Credentials not included

This export does NOT include:

- Webhook secrets.
- API keys or tokens.
- Form notification credentials.
- AWF or Cloudflare form endpoint secrets.

## Portability checklist for forms

- [ ] Form fields documented.
- [ ] Handler type documented.
- [ ] AWF/Cloudflare endpoint caveat documented when applicable.
- [ ] Reconnection / replacement notes included.
- [ ] Phone / email fallback documented.
- [ ] No credentials embedded in static files or `SITE_CONFIG.json`.

