# Status Snapshot — 2026-02-19

**Purpose**: Grounding for app + GitHub. Resend validation + legacy email debt.

---

## 1. Where We Are

### GitHub
- **Open PRs**: 0
- **Open issues**: 20 (see `gh issue list --state open --limit 20`)
- **CI**: Last run on `main` **failed** (workflow 22180221597 — E2E CLI TestPyPI job). Branch `feat/phase3-sharing-karma-acls-launch-docs` had failing CI; no open PR now.
- **Deferred**: No active items. All resolved (Session 027).

### App (production readiness)
- **LAUNCH_STATUS.md**: Soft launch ready (TestPyPI + Stripe test). Registration, costs, API keys, Stripe checkout/portal verified or code-verified.
- **Blocker**: Issue **#187** — `RESEND_API_KEY` not set in **production** → verification emails not sent → new signups cannot verify → blocks acquisition.

### Resend (what was “just set up”)
- **Code**: Implemented and used.
  - `frontend/src/lib/email/send.ts` — Resend SDK; `sendVerificationEmail`, `sendPasswordResetEmail`, `resendVerificationEmail`.
  - `frontend/src/lib/email/templates.ts` — Verification + password reset (HTML + text).
  - Used by: `register`, `resend-verification`, `forgot-password`, `verify-email` flows.
- **Local**: `.env` has `RESEND_API_KEY` (dev works).
- **Production**: Key missing in production `.env` → silent fallback to console-only → no real emails (see #187).

---

## 2. Your Validation (Resend — Issue #187)

**You need to**:
1. Resend dashboard: create API key; verify domain for `noreply@llmhosts.com` (SPF, DKIM, DMARC).
2. Add to **production** env (wherever prod frontend runs):  
   `RESEND_API_KEY=re_xxxxxxxx...`
3. Restart frontend (e.g. `docker compose -f docker-compose.prod.yml -f docker-compose.external-proxy.yml restart llmhosts-frontend`).
4. **E2E test**: Register on https://llmhosts.com → receive verification email → click link → login succeeds.

**Verification checklist** (from #187):
- [ ] Key in production .env
- [ ] Domain verified in Resend
- [ ] Full signup E2E passes

---

## 3. Legacy Email Debt — Resolved (2026-02-19)

- **Root `src/lib/email/`**: Removed. All email in `frontend/src/lib/email/`.
- **Contact form**: Uses shared `sendContactEmail()` (single Resend client).
- **Docs**: EMAIL_VERIFICATION, email-platform-integration, epic-email-ops updated; #187 = only remaining step.

### 3.1 Orphan root (removed) `src/lib/email/` (legacy)
- **Path**: Repo root `src/lib/email/send.ts`, `src/lib/email/templates.ts`.
- **Behavior**: Resend via `fetch()`; `sendEmail()`, `sendVerificationEmail()`; SMTP stub (not implemented). Different template helpers (`getVerificationEmailHTML`, `getVerificationEmailText`).
- **Usage**: **None**. Next.js uses `frontend/src` only (`@/*` → `./src/*`). No imports reference root `src/lib/email`.
- **Conclusion**: Dead code. Safe to remove or move to `docs/archive/` when cleaning.

### 3.2 Contact form — separate Resend init
- **Path**: `frontend/src/app/api/contact/route.ts`.
- **Behavior**: Own `new Resend(process.env.RESEND_API_KEY)`; sends to `hello@llmhosts.com` with `from: "LLMHosts Contact <noreply@llmhosts.com>"`.
- **Debt**: Duplicate Resend client and pattern. Could refactor to use a shared `sendContactEmail()` from `frontend/src/lib/email/send.ts` (single client, consistent env handling).

### 3.3 Docs out of date
- **docs/EMAIL_VERIFICATION.md**: Refers to “Resend API integration: `src/lib/email/send.ts`” — ambiguous; actual implementation is `frontend/src/lib/email/send.ts`. Steps “How to Enable” are largely done (verification is implemented); doc could be updated to “enabled, production key required.”
- **docs/guides/email-platform-integration.md**: Describes Zoho SMTP + support polling. Transactional is now Resend; doc is Phase 1/3 plan, not current Resend-based reality.
- **docs/backlog/epic-email-ops.md**: EM-003 “Transactional Email Service” still BACKLOG; implementation is done, only production key + validation pending.

---

## 4. What’s Next (recommended order)

1. **You**: Resend production validation (issue #187) — add key, verify domain, run E2E signup. Then close #187.
2. **CI**: Fix failing E2E CLI (TestPyPI) job on `main` if Phase 3 work is merged or if main is the branch to keep green.
3. **Cleanup (optional)**:
   - Remove or archive root `src/lib/email/` (dead code).
   - Refactor contact route to use shared email module.
   - Update EMAIL_VERIFICATION.md, email-platform-integration.md, and epic-email-ops.md to reflect Resend and “production key + validation” as only remaining work.

---

## 5. Quick reference

| Item              | Location / command |
|-------------------|--------------------|
| Open issues       | `gh issue list --state open --limit 20` |
| Resend issue      | #187 |
| Email send (live) | `frontend/src/lib/email/send.ts` |
| Email templates   | `frontend/src/lib/email/templates.ts` |
| Contact API       | `frontend/src/app/api/contact/route.ts` |
| Contact form       | Uses `sendContactEmail()` from `@/lib/email/send` |
