Slice · AI prompt
Contact form posting to Resend email API. Server Action + Zod input validation. Convex mutation for storage + Resend send.
# Install `contact-form-resend` — Contact Form + Resend
> Contact form posting to Resend email API.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/contact-form-resend
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=contact-form-resend
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/template-base/frontend/slices/contact-form-resend
## 1. Install
```bash
npx rahman-resources add contact-form-resend
# alias: npx rr add contact-form-resend
```
The CLI copies `template-base/frontend/slices/contact-form-resend/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- npm: `resend`, `framer-motion`
- shadcn primitives: `card`, `button`, `input`, `label`, `textarea`
- peer slices (cascade install):
- `convex-auth` — Optional — anonymous submission works without auth.
- env vars:
- `RESEND_API_KEY` (convex, required)
## 3. Wire it up
Run `npx rr add contact-form-resend`. Wire contactMessages.send mutation in convex/. Server emails via Resend from form@yourdomain.com. Always validate inputs with Zod or v.* server-side. Anonymous allowed.
## Rules of engagement
- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice
The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.