From 78dfadc9d73b40d2d3d84b4e52fb7ca38554269e Mon Sep 17 00:00:00 2001 From: Steven Tey Date: Sun, 29 Dec 2024 23:10:44 -0800 Subject: [PATCH 01/13] Dub Wrapped --- apps/web/emails/clicks-summary.tsx | 2 +- apps/web/emails/components/footer.tsx | 15 +- apps/web/emails/dub-wrapped.tsx | 461 ++++++++++++++++++++++++ apps/web/scripts/dub-wrapped.ts | 98 +++++ packages/prisma/schema/misc.prisma | 18 + packages/prisma/schema/workspace.prisma | 1 + 6 files changed, 593 insertions(+), 2 deletions(-) create mode 100644 apps/web/emails/dub-wrapped.tsx create mode 100644 apps/web/scripts/dub-wrapped.ts create mode 100644 packages/prisma/schema/misc.prisma diff --git a/apps/web/emails/clicks-summary.tsx b/apps/web/emails/clicks-summary.tsx index 0a05cd60d9..afd128cfc6 100644 --- a/apps/web/emails/clicks-summary.tsx +++ b/apps/web/emails/clicks-summary.tsx @@ -142,7 +142,7 @@ export default function ClicksSummary({ align="right" className="text-sm text-gray-600" > - {nFormatter(clicks)} + {nFormatter(clicks, { full: clicks < 99999 })} {index !== topLinks.length - 1 && ( diff --git a/apps/web/emails/components/footer.tsx b/apps/web/emails/components/footer.tsx index 5e97b42170..653dd04a8d 100644 --- a/apps/web/emails/components/footer.tsx +++ b/apps/web/emails/components/footer.tsx @@ -15,7 +15,6 @@ export default function Footer({
We send out product update emails once a month ā€“ no spam, no nonsense. -
Don't want to get these emails?{" "}
+ + Dub Technologies, Inc. +
+ 2261 Market Street STE 5906 +
+ San Francisco, CA 941114 +
); } @@ -49,6 +55,13 @@ export default function Footer({ )} + + Dub Technologies, Inc. +
+ 2261 Market Street STE 5906 +
+ San Francisco, CA 941114 +
); } diff --git a/apps/web/emails/dub-wrapped.tsx b/apps/web/emails/dub-wrapped.tsx new file mode 100644 index 0000000000..bf13949da3 --- /dev/null +++ b/apps/web/emails/dub-wrapped.tsx @@ -0,0 +1,461 @@ +import { COUNTRIES, DUB_WORDMARK, smartTruncate } from "@dub/utils"; +import { nFormatter } from "@dub/utils/src/functions"; +import { + Body, + Column, + Container, + Head, + Heading, + Hr, + Html, + Img, + Link, + Preview, + Row, + Section, + Tailwind, + Text, +} from "@react-email/components"; +import Footer from "./components/footer"; + +export default function DubWrapped({ + email = "panic@thedis.co", + workspace = { + name: "Dub", + slug: "dub", + logo: "https://assets.dub.co/logo.png", + }, + stats = { + "Total Links": 1429, + "Total Clicks": 425319, + }, + topLinks = [ + { + item: "dub.sh/link", + count: 13923, + }, + { + item: "dub.sh/link", + count: 2225, + }, + { + item: "dub.sh/link", + count: 423, + }, + { + item: "dub.sh/link", + count: 325, + }, + { + item: "dub.sh/link", + count: 233, + }, + ], + topCountries = [ + { + item: "US", + count: 23049, + }, + { + item: "GB", + count: 12345, + }, + { + item: "CA", + count: 10000, + }, + { + item: "DE", + count: 9000, + }, + { + item: "FR", + count: 8000, + }, + ], +}: { + email: string; + workspace: { + name: string; + slug: string; + logo: string; + }; + stats: { + "Total Links": number; + "Total Clicks": number; + }; + topLinks: { + item: string; + count: number; + }[]; + topCountries: { + item: string; + count: number; + }[]; +}) { + const dubStats = [ + { + item: "125M clicks tracked", + increase: "+900%", + }, + { + item: "715K links created", + increase: "+400%", + }, + { + item: "65K new users", + increase: "+250%", + }, + { + item: "4.4K domains added", + increase: "+400%", + }, + ]; + + const shippedItems = [ + { + title: "Free .LINK domains on all paid plans", + description: + "We partnered with Nova Registry to offer a 1-year free .link domain to all paying Dub customers. By using a custom domain, you get 30% higher click-through rates.", + image: "https://assets.dub.co/blog/free-dot-link.jpg", + cta: { + text: "Read the announcement", + href: "https://dub.co/blog/introducing-free-domains", + }, + }, + { + title: "New link builder + dashboard", + description: + "We launched a new link builder, rebuilt from the ground up, to help you manage your links better. We also gave our dashboard a makeover as well.", + image: "https://assets.dub.co/changelog/new-dashboard.jpg", + cta: { + text: "Read the announcement", + href: "https://dub.co/blog/new-link-builder", + }, + }, + { + title: "Dub Integrations", + description: + "We added integrations with Slack, Notion, Google Sheets and Google Docs. Our API also went GA", + image: "https://assets.dub.co/blog/integrations.jpg", + cta: { + text: "Read the announcement", + href: "https://dub.co/blog/introducing-dub-integrations", + }, + }, + ]; + + return ( + + + Dub Wrapped + + + +
+ Dub +
+ + Dub Year in Review šŸŽŠ + + + Thank you for your support and here's to another year of your + activity on Dub! Here's a look back at your activity in 2024. + + +
+
+
+ {workspace.name} + + {workspace.name} + +
+ +
+
+ {Object.entries(stats).map(([key, value]) => ( + + ))} +
+
+ + +
+
+ + + Your contribution šŸ“ˆ + + + Thanks to customers like you, we had an incredible year as well, + seeing record activity and link clicks. + + {dubStats.map((stat) => ( + + ā—† {stat.item}{" "} + + ({stat.increase}) + + + ))} + Thank you + +
+ + + What we shipped šŸš¢ + + + Here's a look back at what we shipped in 2024. + + + {shippedItems.map((item) => ( +
+ {item.title} + + {item.title} + + + + {item.cta.text} + +
+ ))} + +
+ + + Thank you again, and happy holidays! + + Email signature + + and everyone at the Dub team šŸŽ„ + + +