Skip to content

Open source CapCut alternative.

TypeScript

docs(site): describe the outbox and the claim rule where the code is

David Le8fc255c32178
diff --git a/site/prisma/Marketing.prisma b/site/prisma/Marketing.prisma
index 657d305f..0a7efed8 100644
--- a/site/prisma/Marketing.prisma
+++ b/site/prisma/Marketing.prisma
@@ -67,7 +67,8 @@ model OutreachTemplate {
// (the experiment rules, minus country) and, optionally, everyone who already
// received earlier promotions left out. The words live here so a draft can be
// edited, test-sent and counted before anything goes out. Sending resolves the
-// segment into recipient rows once and hands them to the promotion-send job.
+// segment into outbox rows once (EmailSend, prisma/Email.prisma) and the
+// outbox drainer mails them under the day's quota.
model Promotion {
creditOffer Json?
diff --git a/site/src/lib/credits/offers.ts b/site/src/lib/credits/offers.ts
index 35b36ceb..7443dedc 100644
--- a/site/src/lib/credits/offers.ts
+++ b/site/src/lib/credits/offers.ts
@@ -133,8 +133,8 @@ export async function landCreditOffer(
return { grant: landed, offer: claimed };
}
-// Claims a manual offer from its email link. An email token never names a
-// promotion's offer; those land from the act they reward.
+// Claims an offer from its email link: the ones su sends by hand and the ones
+// a promotion mails. Every other kind lands from the act it rewards.
export async function claimCreditOffer(offerId: string, userId: string) {
const offer = await prisma.creditOffer.findUnique({ where: { id: offerId } });
if (!offer || (offer.kind !== MANUAL_OFFER_KIND && offer.kind !== "promotion_email")) return null;