CopilotKit / CopilotKit/outpost

Saved template overrides never reach outgoing email

Open
#279 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: product bug
Dominant language
TypeScript
Stars
7
Forks
3
Avg merge
7d 16h
Merged PRs (30d)
15

Description

Template overrides save and preview correctly — PUT /api/templates/[slug] persists through prisma.templateOverride.upsert (apps/web/src/app/api/templates/[slug]/route.ts:125), and the editor previews the unsaved draft (apps/web/src/app/settings/templates/page.tsx:96). What a saved override does not do is reach an outgoing email: the send path still renders the packaged defaults, so an author edits a template, sees the change in the preview, saves it, and every email that goes out is unchanged.

The UI is honest about it today — the save toast and the page description both say so — but they point readers at an issue that no longer exists, so the explanation dead-ends at a 404.

What to do

  • Make the email send path read TemplateOverride and fall back to the packaged default when no override exists
  • Re-point the two user-facing strings at this issue (page.tsx:138, page.tsx:177)
  • Re-point the eleven test docblocks and the middleware.ts:14 comment that reference the removed issues
  • Drop "(preview only)" from the template list badge at page.tsx:221 once sending honours overrides

Acceptance

  • A saved override changes the subject and body of the next outgoing email of that type
  • Removing the override restores the packaged default
  • A test covers override → send, and default → send
  • No string in apps/web or the test suite points at a removed issue number

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the outgoing email send path and compare it with the persistence in apps/web/src/app/api/templates/[slug]/route.ts. Use apps/web/src/app/settings/templates/page.tsx and the referenced middleware.ts comment to update user-facing references, then add tests covering override and default sends. Done means saved overrides affect subject and body, removal restores packaged defaults, and no removed issue numbers remain in apps/web or the test suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.