Slice · AI prompt
Truthful single-opt-in newsletter slice with adapter-backed React/Next and native Svelte 5 subscribe forms, a self-contained Convex subscriber/issue backend, public unsubscribe, host-authorized list/send adapters, and internal Resend campaign workers. The public preview stays unconfigured so it cannot mutate data or send email.
# Install `resend-newsletter` — Resend — Transactional & Newsletter
> Truthful single-opt-in newsletter slice with adapter-backed React/Next and native Svelte 5 subscribe forms, a self-contained Convex subscriber/issue backend, public unsubscribe, host-authorized list/send adapters, and internal Resend campaign workers.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/resend-newsletter
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=resend-newsletter
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/resend-newsletter
## 1. Install
```bash
npm i resend
# alias: npx rr add resend-newsletter
```
The CLI copies `frontend/slices/resend-newsletter/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- npm: `resend`
- shadcn primitives: `button`, `card`, `input`, `label`
- env vars:
- `RESEND_API_KEY` (convex, required)
- `RESEND_FROM` (convex, required)
- convex feature paths: `convex/features/newsletter`
## 3. Wire it up
Run `npx rr add resend-newsletter` for React/default or `npx rr add resend-newsletter --framework sveltekit`. Configure the public subscribe adapter before rendering. The bundled Convex backend is single opt-in: subscribe activates immediately and unsubscribe is public/idempotent. List/send remain host-authorized adapters; after host authz call the internal sendCampaign worker. RESEND_API_KEY/RESEND_FROM stay server-side.
## 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.