Skip to content

feat: add send test email for templates and use draft content#331

Open
hanamizuki wants to merge 1 commit intouseplunk:nextfrom
hanamizuki:fix/test-email-draft-content
Open

feat: add send test email for templates and use draft content#331
hanamizuki wants to merge 1 commit intouseplunk:nextfrom
hanamizuki:fix/test-email-draft-content

Conversation

@hanamizuki
Copy link
Copy Markdown
Contributor

@hanamizuki hanamizuki commented Mar 24, 2026

Summary

  • Add "Send Test Email" feature for templates, matching the existing campaign test email UI and functionality
  • Update both template and campaign test email endpoints to accept optional draft fields (subject, body, from, fromName, replyTo), so test emails reflect the current editor content without requiring a save first

Changes

New: Template Send Test Email

  • apps/api/src/controllers/Templates.ts — new POST /templates/:id/test endpoint
  • apps/api/src/services/TemplateService.tssendTest() method with draft content support
  • apps/web/src/pages/templates/[id].tsx — Send Test button, dialog, and project member selector

Fix: Use draft content for test emails

  • apps/api/src/services/CampaignService.ts — accept optional draft param, use draft fields when present
  • apps/api/src/controllers/Campaigns.ts — pass draft fields from request body to service
  • apps/web/src/pages/campaigns/[id].tsx — send current editor content with test email request

Test plan

  • Open a template, modify subject/body without saving, send test email → verify test email uses the unsaved content
  • Open a campaign, modify subject/body without saving, send test email → verify test email uses the unsaved content
  • Send test email without any unsaved changes → verify it still works (falls back to DB content)
  • Verify test emails can only be sent to project members

🤖 Generated with Claude Code

…t emails

Add a "Send Test Email" feature for templates, matching the existing
campaign test email functionality. Also update both template and
campaign test email endpoints to accept optional draft fields
(subject, body, from, fromName, replyTo) so test emails reflect the
current editor content without requiring a save first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant