Template type is ignored when rendering; deleting a used template fails with 500 #44

Closed
opened 2026-10-15 01:19:26 -04:00 by vmanne-poc · 0 comments
Owner

Bugs

  1. The template type is ignored. Template.type is never used. An HTML template is merged into a Markdown campaign, and the whole result goes through the Markdown parser, which can damage the HTML. The renderer should handle each combination (template type × campaign body type) on purpose: convert the Markdown body first, then merge it into the HTML layout.
  2. Deleting a template that campaigns use gives a 500. The campaign's foreign key has no onDelete rule, so the database rejects the delete and the API returns a 500. It should return 409 when DRAFT or SCHEDULED campaigns use the template, and clear templateId on campaigns that were already sent (as segments do).

Done when

  • Renderer unit tests cover each combination.
  • An e2e test covers deleting a template that campaigns use.
**Bugs** 1. **The template type is ignored.** `Template.type` is never used. An HTML template is merged into a Markdown campaign, and the whole result goes through the Markdown parser, which can damage the HTML. The renderer should handle each combination (template type × campaign body type) on purpose: convert the Markdown body first, then merge it into the HTML layout. 2. **Deleting a template that campaigns use gives a 500.** The campaign's foreign key has no `onDelete` rule, so the database rejects the delete and the API returns a 500. It should return 409 when DRAFT or SCHEDULED campaigns use the template, and clear `templateId` on campaigns that were already sent (as segments do). **Done when** - Renderer unit tests cover each combination. - An e2e test covers deleting a template that campaigns use.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
vmanne-poc/Postak#44
No description provided.