Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/email-drafts-and-publish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"sendlit": minor
"@sendlit/email-blocks": minor
---

Draft and publish for broadcast and sequence emails. While a broadcast or sequence is active (a running sequence or a scheduled broadcast), `sequences.updateEmail` saves subject and content changes as a draft (the email's `draft`, with `hasUnpublishedChanges` on the email and the sequence) and sends keep using the published version. New methods: `sequences.publishChanges` (with `scope: "in_flight" | "new_entrants"` for sequences), `sequences.discardChanges`, `sequences.emailVersions` and `sequences.restoreEmailVersion`. `@sendlit/email-blocks` adds `draft` and `hasUnpublishedChanges` to its sequence types.
5 changes: 5 additions & 0 deletions apps/api/drizzle/0031_email_drafts.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE "email_content_versions" ADD COLUMN "published_at" timestamp with time zone;--> statement-breakpoint
ALTER TABLE "ongoing_sequences" ADD COLUMN "pinned_versions" jsonb;--> statement-breakpoint
ALTER TABLE "sequence_emails" ADD COLUMN "draft_subject" text;--> statement-breakpoint
ALTER TABLE "sequence_emails" ADD COLUMN "draft_content" jsonb;--> statement-breakpoint
ALTER TABLE "sequence_emails" ADD COLUMN "draft_updated_at" timestamp with time zone;
Loading
Loading