feat: add send test email for templates and use draft content#331
feat: add send test email for templates and use draft content#331hanamizuki wants to merge 3 commits into
Conversation
a662b2a to
12d855d
Compare
|
Why did you add parameters for subject, data etc instead of just passing the ID and using the saved values? |
|
Good question — the intent was to let users send a test email while editing, without having to save first. The typical flow when iterating on a template/campaign is: tweak subject/body → check how it looks → tweak again. Requiring a save before every test round means the draft state gets committed to the DB before the user is actually happy with it, which felt a bit awkward for a "preview" action. Passing the current editor values lets the test reflect exactly what's on screen. That said, I totally see the argument for the simpler ID-only approach — it's less surface area on the API and avoids drift between what's saved and what's tested. Happy to go either way:
Let me know which you prefer and I'll adjust. |
0124c85 to
131816a
Compare
131816a to
540f153
Compare
…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>
…no-explicit-any Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
540f153 to
5560e7a
Compare
The Send Test button sat in the page header, which felt disconnected now that the primary Save action lives in the bottom actions row. Move it into that row, immediately to the left of Save Changes, so the test and save actions are grouped together while Delete stays on the left.
Summary
Changes
New: Template Send Test Email
apps/api/src/controllers/Templates.ts— newPOST /templates/:id/testendpointapps/api/src/services/TemplateService.ts—sendTest()method with draft content supportapps/web/src/pages/templates/[id].tsx— Send Test button, dialog, and project member selectorFix: Use draft content for test emails
apps/api/src/services/CampaignService.ts— accept optionaldraftparam, use draft fields when presentapps/api/src/controllers/Campaigns.ts— pass draft fields from request body to serviceapps/web/src/pages/campaigns/[id].tsx— send current editor content with test email requestTest plan
🤖 Generated with Claude Code