Files
Oleg Isonen fc38f71ba2 docs: Document self-hosted email tRPC interface (#6542)
Document the email service interface used by the Builder's server-side
tRPC call.

- Specify `POST /trpc/email.send`, bearer authorization, project-ID
metadata, direct JSON input, attachment encoding, and the tRPC
delivery-result envelope.
- Document `TRPC_SERVER_API_TOKEN` and `EMAIL_SERVICE_URL`, including
the current restriction to approved Webstudio Worker origins. The docs
do not claim that an arbitrary self-hosted origin can be configured
today.
- Keep the endpoint contract focused on its external HTTP interface.

Validation:
- A clean-room implementation from the original REST wording returned
404 for the Builder's `/trpc/email.send` request.
- I discarded it, revised the docs, then tested from scratch using the
actual Builder `createCloudflareManagedFormEmailSenderWithUrl` helper
from this PR head against a local fake tRPC endpoint. Success and
delivery-failure responses passed; the emitted URL, method, headers, and
direct JSON payload matched the contract.
- Confirmed the actual Builder helper rejects an arbitrary self-hosted
URL. The endpoint used a fake provider; no email was sent.
- The focused SDK managed-form email suite passes: 57 tests.
Documentation only; no deployment.
2026-10-17 02:38:56 +02:00
..