feat: email template library + /templates page + Browse picker (HIR-75)#2
Merged
pypesdev merged 1 commit intopypesdev:mainfrom May 2, 2026
Merged
Conversation
Seeds 6 starter templates (saas_onboarding, agency_outreach,
recruiter_outbound, b2b_warm_intro, founder_to_founder,
re_engagement_silent_3day) in src/lib/templates/catalog.ts using the
existing {{variable}} placeholder syntax from the campaigns API.
- /templates renders a grid with preview + 'Use this template'
- /dashboard/campaigns/new is a single-step sequence form with a
'Browse templates' modal and ?templateId= prefill
- Catalog test enforces every {{placeholder}} is declared in
variables[] and vice versa, so future templates stay consistent
Closes HIR-75. Ticks the 'Templates for popular email needs'
TODO in the README.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the first 'move the needle' README TODO: a starter email template library.
src/lib/templates/catalog.ts— 6 seeded templates (saas_onboarding,agency_outreach,recruiter_outbound,b2b_warm_intro,founder_to_founder,re_engagement_silent_3day) using the existing{{variable}}placeholder syntax from the campaigns API (src/app/api/campaigns/route.ts)./templates(Next.js app router) — grid of template cards with preview + 'Use this template' that hands off to the sequence form./dashboard/campaigns/new— single-step sequence-creation form with a 'Browse templates' button that opens the same picker as a modal, and?templateId=prefill from the templates page.tests/int/templates.int.spec.ts— 10 unit tests (vitest) verifying:{{placeholder}}in subject/body is declared invariables[]extractPlaceholdersandgetTemplateByIdbehave correctlyNotes for reviewers
{{first_name}}(existing campaigns API syntax) rather than the{first_name}shape mentioned in the issue body — per the engineer's note to match the existing templating system./api/campaignsendpoint), so I added a minimal one at/dashboard/campaigns/new. That gives the modal somewhere to live without introducing a new abstraction.Test plan
pnpm exec vitest run --config ./vitest.config.mts tests/int/templates.int.spec.ts— 10/10 passpnpm exec next lintclean on all new filespnpm exec tsc --noEmit— no new type errors introduced (pre-existing errors inlibs/db,src/app/api/campaigns/route.ts, etc. are unchanged)/templatesand/dashboard/campaigns/new(auth-gated, deferred to local run)Definition of done
pypesdev/coldflowmain branch/templatespage (rendered viaTemplatePicker)applyTemplate)Closes HIR-75. Parent: HIR-74.