Skip to content

Contact: Resend email delivery + fallback address - #6

Merged
durga710 merged 2 commits into
mainfrom
contact-delivery
Sep 13, 2026
Merged

durga710 merged 2 commits into
mainfrom
contact-delivery

Conversation

@durga710

@durga710 durga710 commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

Why

Production had no enquiry receiver configured, so the contact form returned 503 on every real submission and the site showed no email address anywhere.

What

  • POST /api/project gains a Resend delivery mode (RESEND_API_KEY, ENQUIRY_INBOX, optional ENQUIRY_FROM). Webhook mode still wins when both are set; the route still fails closed without the shared rate limiter.
  • Rate limiter accepts the Vercel Marketplace Upstash names (KV_REST_API_URL / KV_REST_API_TOKEN) as well as UPSTASH_REDIS_REST_*. RATE_LIMIT_SECRET is now optional and derived from the Redis token when unset.
  • Enquiry emails are plain text with reply_to set to the enquirer and a SHA-256 Idempotency-Key so client retries do not duplicate.
  • hello@ghimtech.org is shown in the contact aside, the footer, and beneath any failed-submission status.
  • .env.example documents both delivery options.

Verification

  • node --test: 22 passing (5 new).
  • tsc --noEmit and next build clean.
  • Playwright + axe sweep over 12 routes x 9 widths: zero overflow, zero a11y violations, zero runtime errors; all interaction checks pass.

Already done in Vercel

Upstash Redis upstash-kv-bole-forest (Free plan) is connected to ghim-tech for Production and Preview with the KV_ prefix.

After merge

Add RESEND_API_KEY and ENQUIRY_INBOX to Production environment variables, then redeploy.

The enquiry route accepted only a bearer-token webhook, and none was
configured in production, so every real submission ended in a 503 with
no other way to reach us. This adds a second delivery mode that emails
each enquiry through Resend (RESEND_API_KEY + ENQUIRY_INBOX, optional
ENQUIRY_FROM), keeps the webhook as the preferred mode when both are
set, and still fails closed without a shared rate limiter.

hello@ghimtech.org now appears in the contact aside, the footer, and
under any failed-submission status so visitors always have a channel.

Tests: 21 passing (4 new for Resend mode, precedence, and fail-closed).
@vercel

vercel Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ghim-tech Ready Ready Preview Sep 13, 2026 4:26pm UTC

…g secret

The Upstash integration installed through the Vercel Marketplace injects
KV_REST_API_URL and KV_REST_API_TOKEN rather than the UPSTASH_REDIS_REST_*
names. Accept either pair. When RATE_LIMIT_SECRET is unset, derive the
key-hashing secret from the Redis token instead of failing closed: the
token already grants full access to the keys it would protect.
@durga710
durga710 merged commit 58f12d1 into main Sep 13, 2026
4 of 5 checks passed
@durga710
durga710 deleted the contact-delivery branch September 13, 2026 16:30
durga710 added a commit that referenced this pull request Sep 13, 2026
… delivery

- Prettier: reformat the enquiry route and its tests (CI format:check
  was failing on main since #6).
- Serve a real /favicon.ico (16/32/48 PNG-in-ICO rendered from icon.svg)
  so legacy user agents and link previews stop hitting a 404.
- README: document Resend delivery, the Marketplace KV variable names,
  the optional hashing secret, and the correct Vercel root directory.
- Release notes: delivery gate reflects the two delivery modes.

This branch was successfully deployed

1 active deployment
Preview — f555a5c2 Deployed Sep 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant