Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix: improve partner sale alert email for zero holding periods

Kiran K23d1aa946730
diff --git a/packages/email/src/templates/new-sale-alert-partner.tsx b/packages/email/src/templates/new-sale-alert-partner.tsx
index 40edd01e8d..c7334e38cc 100644
--- a/packages/email/src/templates/new-sale-alert-partner.tsx
+++ b/packages/email/src/templates/new-sale-alert-partner.tsx
@@ -23,7 +23,7 @@ export default function NewSaleAlertPartner({
name: "Acme",
slug: "acme",
logo: DUB_WORDMARK,
- holdingPeriodDays: 30,
+ holdingPeriodDays: 0,
},
sale = {
amount: 4900,
@@ -96,18 +96,28 @@ export default function NewSaleAlertPartner({
<Text className="text-sm leading-6 text-neutral-600">
You received{" "}
<strong className="text-black">{earningsInDollars}</strong> in
- commission for this sale and it will be eligible for payout after
- the program's {program.holdingPeriodDays}-day holding period (
- <strong>
- {new Date(
- Date.now() + program.holdingPeriodDays * 24 * 60 * 60 * 1000,
- ).toLocaleDateString("en-US", {
- month: "long",
- day: "numeric",
- year: "numeric",
- })}
- </strong>
- ).
+ commission for this sale
+ {program.holdingPeriodDays > 0 ? (
+ <>
+ {" "}
+ and it will be eligible for payout after the program's{" "}
+ {program.holdingPeriodDays}-day holding period (
+ <strong>
+ {new Date(
+ Date.now() +
+ program.holdingPeriodDays * 24 * 60 * 60 * 1000,
+ ).toLocaleDateString("en-US", {
+ month: "long",
+ day: "numeric",
+ year: "numeric",
+ })}
+ </strong>
+ )
+ </>
+ ) : (
+ " and it will be included in your next payout"
+ )}
+ .
</Text>
<Section className="mb-12 mt-8">