Day 12 — nobody misses appointments. 📧 Money's moving, reviews are live — now ClipBook talks to its users. This morning: transactional emails — booking confirmed, a 24h reminder before the cut, a review request after completion, and cancellation notices. Paste this into Claude Code / Cursor (agent mode): ⬇️ Build transactional emails for ClipBook (Next.js 14 App Router, TypeScript, Tailwind CSS, Supabase). Use Resend for sending — add RESEND_API_KEY to .env.local (test key first). 1. BRANDED TEMPLATE — components/email/EmailLayout.tsx: - HTML email template (email clients are stuck in 2005 — use table-based layout, inline styles, no Tailwind). - ClipBook header (logo text + brand color bar), footer with unsubscribe + app links. Works in Gmail, Outlook, Apple Mail. - Preview all emails locally before wiring them up. 2. EMAIL SENDER — lib/email.ts: - sendEmail(to, subject, html) helper with error handling and logging. Queue failures for retry — never let a send error break the booking flow. - One function per email type: bookingConfirmedEmail(booking), bookingReminderEmail(booking), reviewRequestEmail(booking), cancellationEmail(booking, reason). 3. THE FOUR EMAILS: - Booking confirmed (fires from the booking flow after payment succeeds — Day 11A): service, barber, date/time, price paid, "Add to calendar" note, refund policy line. - Reminder 24h before (cron or Supabase edge function scheduled daily at 8 AM, querying bookings where start_time is tomorrow): "Your cut with {barber} is tomorrow at {time}." - Review request (fires when booking → 'completed', from Day 6 status flow): deep link to the booking page with the review modal pre-opened (Day 10A). - Cancellation notice (fires from the cancel flow, Day 11B): refund amount + timeline if refunded, or the 24h policy note if not. - All four must be idempotent: an emails_sent table (booking_id, email_type, sent_at) with a unique constraint so retries and double-fires never send duplicates.