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 apps/api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ GOOGLE_CLIENT_SECRET=
# CONTENT_SCAN=heuristic # off | heuristic | ai (default ai when ANTHROPIC_API_KEY is set)
# ANTHROPIC_API_KEY=

# Test sends (all deployments). Every recipient counts once; windows are rolling.
# TEST_SEND_DAILY_LIMIT=100 # per team, any 24 hours
# TEST_SEND_BURST_LIMIT=50 # per team, any TEST_SEND_BURST_HOURS
# TEST_SEND_BURST_HOURS=3
# TEST_SEND_EMAIL_DAILY_LIMIT=20 # per email, any 24 hours

# Optional: Google Postmaster Tools on the dashboard's Sender reputation card.
# Create an OAuth client (type "Web application") in Google Cloud, enable the
# Gmail Postmaster Tools API, and add <API public URL>/integrations/google-postmaster/callback
Expand Down
18 changes: 18 additions & 0 deletions apps/api/drizzle/0023_sent_content_versions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TABLE "email_content_versions" (
"id" uuid PRIMARY KEY NOT NULL,
"version_id" text NOT NULL,
"team_id" uuid NOT NULL,
"sequence_email_id" uuid NOT NULL,
"content_hash" text NOT NULL,
"subject" text NOT NULL,
"content" jsonb NOT NULL,
"created_at" timestamp with time zone DEFAULT now(),
CONSTRAINT "email_content_versions_version_id_unique" UNIQUE("version_id"),
CONSTRAINT "email_content_versions_version_id_check" CHECK ("email_content_versions"."version_id" ~ '^ver_')
);
--> statement-breakpoint
ALTER TABLE "email_deliveries" ADD COLUMN "content_version_id" uuid;--> statement-breakpoint
ALTER TABLE "email_content_versions" ADD CONSTRAINT "email_content_versions_team_id_teams_id_fk" FOREIGN KEY ("team_id") REFERENCES "public"."teams"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "email_content_versions" ADD CONSTRAINT "email_content_versions_sequence_email_id_sequence_emails_id_fk" FOREIGN KEY ("sequence_email_id") REFERENCES "public"."sequence_emails"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "email_content_versions_email_hash_idx" ON "email_content_versions" USING btree ("sequence_email_id","content_hash");--> statement-breakpoint
ALTER TABLE "email_deliveries" ADD CONSTRAINT "email_deliveries_content_version_id_email_content_versions_id_fk" FOREIGN KEY ("content_version_id") REFERENCES "public"."email_content_versions"("id") ON DELETE set null ON UPDATE no action;
Loading
Loading