feat(emails): shared house-style email layout wrapper (consistency pass)
What
Welcome, valuation, and weekly-report emails should share one visual language (DESIGN.md — four-font system, shadow-as-border, achromatic chrome), but each outbound email was assembled ad hoc (rendered body + a bare footer). This is the consistency pass from recoupable/chat#1885 — it establishes the shared email template.
Changes
renderEmailLayout(lib/emails/) — one sharedheader + footer + optional-CTAwrapper:- Recoup wordmark header
- achromatic shadow-as-border card (
box-shadow, not a CSSborder, per DESIGN.md) - the DESIGN.md font stack (Plus Jakarta Sans → system fallbacks)
- literal hex brand tokens (email clients can't read CSS variables), centered fixed-max-width container
- email-client-safe: all styles inline, webfonts degrade to system fonts.
processAndSendEmail— adopts the wrapper as the proof point. This is the path the live weekly-report email flows through (agentsend_email→processAndSendEmail), so the already-live weekly report now renders in the shared house style, with the existinggetEmailFooteroutput carried in as the layout footer.
Note
The welcome (api#774) and valuation (api#773) emails will adopt this same renderEmailLayout wrapper once merged — this PR establishes the shared template they align to, so all three read as one family.
Verification
- TDD RED→GREEN:
renderEmailLayout— wraps body; includes footer when given / omits when not; renders CTA button (label + href) when given / none otherwise; carries house-style markers (wordmark,#0a0a0aink,box-shadowcard, Plus Jakarta Sans,max-width).processAndSendEmail— the sent HTML preserves the body and is wrapped in the shared layout (wordmark + shadow-as-border + font stack).
- Full
lib/emailsdomain suite green — 159 tests passing (existingprocessAndSendEmailbehavior unchanged). tsc --noEmit: no errors in changed files (1 pre-existing baseline error inprocessAndSendEmail.test.tsis unchanged, only line-shifted).eslint+prettierclean on all changed files.
Targets main.
Relates to recoupable/chat#1885 (consistency pass across onboarding emails).
🤖 Generated with Claude Code
Summary by cubic
Add a shared house‑style email layout and adopt it across weekly report, welcome, and valuation emails. This completes the consistency pass so onboarding emails use one visual language (recoupable/chat#1885).
-
New Features
lib/emails/renderEmailLayout: shared wrapper (header, footer, optional CTA) with Recoup wordmark, shadow‑as‑border card (box-shadow), DESIGN.md font stack, centered max‑width container, inline styles, and literal hex tokens.- Adopted in
lib/emails/processAndSendEmail,lib/emails/buildWelcomeEmail, andlib/emails/valuationReport/renderValuationReportHtml; these now provide only body/CTA/footer and render through the new layout.
-
Bug Fixes
- Single‑quoted font names in the font stack to avoid breaking
style="…"in email clients; added a regression test inrenderEmailLayout.test.ts.
- Single‑quoted font names in the font stack to avoid breaking