Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat: emails updates and new emails.
Iuliia Shnaia815ac527c1a
diff --git a/components/domains/add-domain-modal.tsx b/components/domains/add-domain-modal.tsxindex 4b31d12a..a3e5f4f2 100644--- a/components/domains/add-domain-modal.tsx+++ b/components/domains/add-domain-modal.tsx@@ -1,4 +1,6 @@-import { useState } from "react";+import { useRef, useState } from "react";++import { useSession } from "next-auth/react";import { useTeam } from "@/context/team-context";import { PlanEnum } from "@/ee/stripe/constants";@@ -6,6 +8,7 @@ import { toast } from "sonner";import { z } from "zod";import { useAnalytics } from "@/lib/analytics";+import { sendCustomDomainSetupEmail } from "@/lib/emails/send-custom-domain-setup";import { usePlan } from "@/lib/swr/use-billing";import useLimits from "@/lib/swr/use-limits";@@ -40,9 +43,11 @@ export function AddDomainModal({}) {const [domain, setDomain] = useState<string>("");const [loading, setLoading] = useState<boolean>(false);+ const emailSentRef = useRef<boolean>(false);+ const { data: session } = useSession();const teamInfo = useTeam();- const { isFree, isPro, isBusiness } = usePlan();+ const { isFree, isPro, isBusiness, isDatarooms, isDataroomsPlus } = usePlan();const { limits } = useLimits();const analytics = useAnalytics();const addDomainSchema = z.object({@@ -103,6 +108,27 @@ export function AddDomainModal({!onAddition && window.open("/settings/domains", "_blank");};+ // Send first-time custom domain email when modal opens+ const sendFirstTimeEmail = async () => {+ if (emailSentRef.current || !session?.user?.email) return;++ const hasCustomDomainAccess = linkType === "DATAROOM_LINK"+ ? (isDatarooms || isDataroomsPlus || limits?.customDomainInDataroom)+ : (isBusiness || isDatarooms || isDataroomsPlus || limits?.customDomainOnPro);++ try {+ await sendCustomDomainSetupEmail(+ session.user.email,+ session.user.name || undefined,+ teamInfo?.currentTeam?.plan || "free",+ hasCustomDomainAccess+ );+ emailSentRef.current = true;+ } catch (error) {+ console.error("Failed to send custom domain email:", error);+ }+ };+// If the team is// - on a free plan// - on pro plan and has custom domain on pro plan disabled@@ -126,6 +152,7 @@ export function AddDomainModal({}highlightItem={["custom-domain"]}trigger="add_domain_overview"+ onClick={sendFirstTimeEmail}/>);} else {@@ -137,7 +164,12 @@ export function AddDomainModal({: PlanEnum.Business}open={open}- setOpen={setOpen}+ setOpen={(isOpen) => {+ if (isOpen) {+ sendFirstTimeEmail();+ }+ setOpen(isOpen);+ }}trigger={"add_domain_link_sheet"}highlightItem={["custom-domain"]}/>@@ -146,7 +178,15 @@ export function AddDomainModal({}return (- <Dialog open={open} onOpenChange={setOpen}>+ <Dialog+ open={open}+ onOpenChange={(isOpen) => {+ if (isOpen) {+ sendFirstTimeEmail();+ }+ setOpen(isOpen);+ }}+ ><DialogTrigger asChild>{children}</DialogTrigger><DialogContent className="sm:max-w-[425px]"><DialogHeader className="text-start">diff --git a/components/emails/custom-domain-setup.tsx b/components/emails/custom-domain-setup.tsxnew file mode 100644index 00000000..171a9dfc--- /dev/null+++ b/components/emails/custom-domain-setup.tsx@@ -0,0 +1,154 @@+import React from "react";++import {+ Body,+ Button,+ Container,+ Head,+ Hr,+ Html,+ Link,+ Preview,+ Section,+ Tailwind,+ Text,+} from "@react-email/components";++export default function CustomDomainSetup({+ name = "there",+ currentPlan = "Free",+ hasAccess = false,+}: {+ name?: string;+ currentPlan?: string;+ hasAccess?: boolean;+}) {+ const getPlanInfo = () => {+ if (hasAccess) {+ return {+ title: "Your custom domain is ready to set up! π",+ subtitle: `Great news! Your ${currentPlan} plan includes custom domain access.`,+ };+ } else {+ return {+ title: "Interested in custom domains? π",+ subtitle: "Learn how custom domains can enhance your document sharing experience.",+ };+ }+ };++ const { title, subtitle } = getPlanInfo();++ return (+ <Html>+ <Head />+ <Preview>Your Papermark custom domain set up</Preview>+ <Tailwind>+ <Body className="mx-auto my-auto bg-white font-sans">+ <Container className="mx-auto my-10 w-[465px] p-5">+ <Text className="mx-0 mb-8 mt-4 p-0 text-center text-2xl font-normal">+ <span className="font-bold tracking-tighter">Papermark</span>+ </Text>+ <Text className="mx-0 my-7 p-0 text-center text-xl font-semibold text-black">+ {title}+ </Text>+ <Text className="text-sm leading-6 text-black">+ Hi {name},+ </Text>+ <Text className="text-sm leading-6 text-black">+ {subtitle}+ </Text>++ {!hasAccess && (+ <>+ <Text className="text-sm leading-6 text-black">+ <strong>Custom domains are available: </strong>+ </Text>+ <ul className="list-inside list-disc text-sm">+ <li><strong>Business Plan:</strong> Custom domain for documents</li>+ <li><strong>Data Rooms Plan:</strong> Custom domain for data rooms</li>+ <li><strong>Data Rooms Plus:</strong> Unlimited custom domains for data rooms and documents</li>+ </ul>+ </>+ )}+++ <Text className="text-sm leading-6 text-black">+ <strong>Setting up your custom domain:</strong>+ </Text>+ <ol className="list-inside list-decimal text-sm">+ <li>Choose your subdomain (e.g., docs.yourcompany.com)</li>+ <li>Add a CNAME record pointing to papermark.com</li>+ <li>Configure the domain in your Papermark settings</li>+ <li>Start sharing with your branded domain!</li>+ </ol>++ <Section className="my-8 text-center">+ {hasAccess ? (+ <Button+ className="rounded bg-black text-center text-xs font-semibold text-white no-underline"+ href={`https://app.papermark.com/settings/domains`}+ style={{ padding: "12px 20px" }}+ >+ Set up your custom domain+ </Button>+ ) : (+ <Button+ className="rounded bg-black text-center text-xs font-semibold text-white no-underline"+ href={`https://app.papermark.com/settings/upgrade`}+ style={{ padding: "12px 20px" }}+ >+ Upgrade to get custom domains+ </Button>+ )}+ </Section>++ <Text className="text-sm leading-6 text-black">+ {hasAccess ? (+ <>+ Need help? Check out our{" "}+ <Link+ href="https://docs.papermark.com/custom-domains"+ className="font-medium text-blue-600 no-underline"+ >+ custom domain documentation+ </Link>{" "}+ or reply to this email - we're here to help!+ </>+ ) : (+ <>+ Want to learn more about our plans?{" "}+ <Link+ href="https://app.papermark.com/settings/upgrade"+ className="font-medium text-blue-600 no-underline"+ >+ View pricing+ </Link>{" "}+ or reply to this email if you have any questions!+ </>+ )}+ </Text>++ <Hr />+ <Section className="mt-8 text-gray-400">+ <Text className="text-xs">+ Β© {new Date().getFullYear()}{" "}+ <a+ href="https://www.papermark.com"+ className="text-gray-400 no-underline hover:text-gray-400"+ target="_blank"+ >+ papermark.com+ </a>+ </Text>+ <Text className="text-xs">+ If you have any questions about setting up your custom domain,+ simply reply to this email. We'd love to help you get started!+ </Text>+ </Section>+ </Container>+ </Body>+ </Tailwind>+ </Html>+ );+}\ No newline at end of filediff --git a/components/emails/onboarding-5.tsx b/components/emails/data-rooms-information.tsxsimilarity index 75%rename from components/emails/onboarding-5.tsxrename to components/emails/data-rooms-information.tsxindex 35aa91af..ea287665 100644--- a/components/emails/onboarding-5.tsx+++ b/components/emails/data-rooms-information.tsx@@ -30,30 +30,27 @@ const Onboarding3Email = () => {Virtual Data Rooms</Text><Text className="text-sm">Unlimited branded data rooms!</Text>- <Text className="text-sm">With Papermark Data Rooms you can:</Text>+ <Text className="text-sm">With Papermark Data Rooms plan you can:</Text>+ <ul className="list-inside list-disc text-sm">+ <li>Share data rooms with one link</li>+ <li>Upload unlimited files</li>+ <li>Create unlimited folders and subfolders</li>+ <li>+ Connect your <strong>custom domain π«</strong>{" "}+ </li>+ <li>Create fully branded experience </li>+ <li>Use advanced link settings</li>++ </ul><Text className="text-sm">- <ul className="list-inside list-disc text-sm">- <li>Share data rooms with one link</li>- <li>Upload unlimited files</li>- <li>Create unlimited folders and subfolders</li>- <li>- Connect your <strong>custom domain π«</strong>{" "}- </li>- <li>Create fully branded experience </li>- <li>Use advanced link settings</li>- <li>Create full whitelabeling</li>- <li>Build self-hosted expereince</li>- </ul>- <Text className="text-sm">- All about Papermark{" "}- <a- href="https://www.papermark.com/data-room"- className="text-blue-500 underline"- >- Data Rooms- </a>{" "}- features and plans- </Text>+ All about Papermark{" "}+ <a+ href="https://www.papermark.com/data-room"+ className="text-blue-500 underline"+ >+ Data Rooms+ </a>{" "}+ features and plans</Text>{/* <Text className="text-sm">You can also use Bulk upload</Text> */}<Section className="mb-[32px] mt-[32px] text-center">diff --git a/components/emails/trial-end-reminder.tsx b/components/emails/dataroom-trial-24h.tsxsimilarity index 66%rename from components/emails/trial-end-reminder.tsxrename to components/emails/dataroom-trial-24h.tsxindex 8a993034..3f076d0f 100644--- a/components/emails/trial-end-reminder.tsx+++ b/components/emails/dataroom-trial-24h.tsx@@ -7,6 +7,7 @@ import {Head,Hr,Html,+ Link,Preview,Section,Tailwind,@@ -18,7 +19,7 @@ interface TrialEndReminderEmail {}const TrialEndReminderEmail = ({ name }: TrialEndReminderEmail) => {- const previewText = `Upgrade to Papermark Pro`;+ const previewText = `Upgrade to Papermark Data Rooms Plan`;return (<Html>@@ -31,43 +32,38 @@ const TrialEndReminderEmail = ({ name }: TrialEndReminderEmail) => {<span className="font-bold tracking-tighter">Papermark</span></Text><Text className="font-seminbold mx-0 mb-8 mt-4 p-0 text-center text-xl">- Your pro trial is almost over+ Your Data Room plan trial expires in 24 hours</Text><Text className="text-sm leading-6 text-black">Hey{name && ` ${name}`}!</Text><Text className="text-sm leading-6 text-black">- Your Papermark Pro trial is almost over. If you want to continue- enjoying the Pro features, please consider upgrading your plan.- </Text>- <Text className="text-sm leading-6 text-black">- On the Pro plan, you have access to:- </Text>- <Text className="ml-1 text-sm leading-4 text-black">- β Custom domains- </Text>- <Text className="ml-1 text-sm leading-4 text-black">- β Team members- </Text>- <Text className="ml-1 text-sm leading-4 text-black">- β Unlimited documents- </Text>- <Text className="ml-1 text-sm leading-4 text-black">- β Large file uploads+ Your Papermark Data Room plan trial expires in 24 hours. Don't lose access to these features -{" "}+ <Link href={`https://app.papermark.com/settings/billing`}>+ upgrade today+ </Link>:</Text>+ <ul className="list-inside list-disc text-sm">+ <li>Build unlimited <strong>data rooms</strong></li>+ <li>Upload files of any <strong>size</strong></li>+ <li>Collaborate with your <strong>team</strong></li>+ <li>Set up <strong>secure link permissions</strong> and controls</li>+ <li>Brand everything with your <strong>custom domain</strong></li>+ <li>Track detailed <strong>analytics</strong> and user activity</li>+ </ul><Section className="mb-[32px] mt-[32px] text-center"><ButtonclassName="rounded bg-black text-center text-xs font-semibold text-white no-underline"href={`https://app.papermark.com/settings/billing`}style={{ padding: "12px 20px" }}>- Upgrade your plan+ Upgrade now</Button></Section><Text className="text-sm font-semibold">- <span className="text-red-500">β οΈ</span> Links with custom domains- will be <span className="text-red-500 underline">disabled</span>{" "}- after your trial.+ <span className="text-red-500">β οΈ</span> Dataroom links and links+ with advanced access controls will be{" "}+ <span className="text-red-500 underline">disabled</span> in 24 hours.</Text><Text className="text-sm text-gray-400">Marc from Papermark</Text><Hr />diff --git a/components/emails/dataroom-trial-end.tsx b/components/emails/dataroom-trial-end.tsxindex f8f294a9..abfccb2b 100644--- a/components/emails/dataroom-trial-end.tsx+++ b/components/emails/dataroom-trial-end.tsx@@ -32,34 +32,26 @@ const DataroomTrialEnd = ({ name }: DataroomTrialEnd) => {<span className="font-bold tracking-tighter">Papermark</span></Text><Text className="font-seminbold mx-0 mb-8 mt-4 p-0 text-center text-xl">- Your dataroom trial has expired+ Your Data Room plan trial has expired</Text><Text className="text-sm leading-6 text-black">Hey{name && ` ${name}`}!</Text><Text className="text-sm leading-6 text-black">- Your Papermark dataroom trial has expired.{" "}+ Your Papermark Data Room plantrial has expired.{" "}<Link href={`https://app.papermark.com/settings/billing`}>Upgrade now</Link>{" "}to:</Text>- <Text className="ml-1 text-sm leading-4 text-black">- β Create new datarooms- </Text>- <Text className="ml-1 text-sm leading-4 text-black">- β Share datarooms with your{" "}- <span className="font-bold">custom domain</span>- </Text>- <Text className="ml-1 text-sm leading-4 text-black">- β Invite your <span className="font-bold">team members</span>- </Text>- <Text className="ml-1 text-sm leading-4 text-black">- β Share <span className="font-bold">unlimited documents</span>- </Text>- <Text className="ml-1 text-sm leading-4 text-black">- β Upload <span className="font-bold">large</span> files- </Text>+ <ul className="list-inside list-disc text-sm">+ <li>Create new datarooms</li>+ <li>Upload <strong>large</strong> files</li>+ <li>Invite your <strong>team members</strong></li>+ <li>Protect documents with <strong>advanced access controls</strong></li>+ <li>Share documents and data rooms with <strong>custom domain</strong></li>+ <li>Access advanced analytics and audit logs</li>+ </ul><Section className="mb-[32px] mt-[32px] text-center"><ButtonclassName="rounded bg-black text-center text-xs font-semibold text-white no-underline"diff --git a/components/emails/export-ready.tsx b/components/emails/export-ready.tsxindex 0bec06a2..ce93103c 100644--- a/components/emails/export-ready.tsx+++ b/components/emails/export-ready.tsx@@ -48,13 +48,11 @@ export default function ExportReady({<Text className="text-sm leading-6 text-black">Export details:</Text>- <Text className="break-all text-sm leading-6 text-black">- <ul>- <li className="text-sm leading-6 text-black">- Export type: {resourceName}- </li>- </ul>- </Text>+ <ul className="break-all text-sm leading-6 text-black">+ <li className="text-sm leading-6 text-black">+ Export type: {resourceName}+ </li>+ </ul><Text className="text-sm leading-6 text-black">Best,<br />diff --git a/components/emails/hundred-views-congrats.tsx b/components/emails/hundred-views-congrats.tsxnew file mode 100644index 00000000..9ddd274a--- /dev/null+++ b/components/emails/hundred-views-congrats.tsx@@ -0,0 +1,46 @@+import React from "react";++import { Body, Head, Html, Link, Preview, Tailwind, Text } from "@react-email/components";++interface HundredViewsCongratsEmailProps {+ name: string | null | undefined;+}++const HundredViewsCongratsEmail = ({ name }: HundredViewsCongratsEmailProps) => {+ return (+ <Html>+ <Head />+ <Preview>100 views on Papermark. Awesome, {name}</Preview>+ <Tailwind>+ <Body className="font-sans text-sm">+ <Text>Hi {name},</Text>+ <Text>+ I'm Marc, founder of Papermark. Congrats on 100 views on your documents.+ </Text>+ <Text>+ Would you help others discover us too?+ </Text>+ <Text>+ <Link+ href="https://www.g2.com/products/papermark/reviews"+ target="_blank"+ className="text-blue-500 underline"+ >+ Leave a review on G2 β+ </Link>+ </Text>+ <Text>+ Small gift from us inside.+ </Text>+ <Text>+ Thanks so much,+ <br />+ Marc+ </Text>+ </Body>+ </Tailwind>+ </Html>+ );+};++export default HundredViewsCongratsEmail;\ No newline at end of filediff --git a/components/emails/onboarding-1.tsx b/components/emails/onboarding-1.tsxindex b7062ae7..6bb21e36 100644--- a/components/emails/onboarding-1.tsx+++ b/components/emails/onboarding-1.tsx@@ -36,15 +36,13 @@ const Onboarding1Email = () => {With Papermark you can upload different kind of documents and turnthem into shareable links:</Text>+ <ul className="list-inside list-disc text-sm">+ <li>PDFs</li>+ <li>Excel, CSV files</li>+ <li>Notion via link</li>+ </ul><Text className="text-sm">- <ul className="list-inside list-disc text-sm">- <li>PDFs</li>- <li>Excel, CSV files</li>- <li>Notion via link</li>- </ul>- <Text className="text-sm">- (All Notion changes are instantly reflected in shared documents)- </Text>+ (All Notion changes are instantly reflected in shared documents)</Text><Text className="text-sm">You can also use <strong>Bulk upload π«</strong> Just drop manydiff --git a/components/emails/onboarding-2.tsx b/components/emails/onboarding-2.tsxindex 1c609b85..32a5370b 100644--- a/components/emails/onboarding-2.tsx+++ b/components/emails/onboarding-2.tsx@@ -36,17 +36,15 @@ const Onboarding2Email = () => {With Papermark you can use different link settings for shareddocuments and data rooms:</Text>- <Text className="text-sm">- <ul className="list-inside list-disc text-sm">- <li>Require email to view</li>- <li>Expiration date</li>- <li>Allow & block list π</li>- <li>Email verification</li>- <li>Password protection</li>- <li>NDA and other agreements</li>- <li>Screenshot protection</li>- </ul>- </Text>+ <ul className="list-inside list-disc text-sm">+ <li>Require email to view</li>+ <li>Expiration date</li>+ <li>Allow & block list π</li>+ <li>Email verification</li>+ <li>Password protection</li>+ <li>NDA and other agreements</li>+ <li>Screenshot protection</li>+ </ul>{/* <Text className="text-sm">You can also use Bulk upload</Text> */}<Section className="mb-[32px] mt-[32px] text-center"><Buttondiff --git a/components/emails/onboarding-3.tsx b/components/emails/onboarding-3.tsxindex 4f01ddf5..3df1eae8 100644--- a/components/emails/onboarding-3.tsx+++ b/components/emails/onboarding-3.tsx@@ -36,20 +36,15 @@ const Onboarding3Email = () => {With Papermark you can track progress on each page of yourdocument and other analytics:</Text>- <Text className="text-sm">- <ul className="list-inside list-disc text-sm">- <li>- Track time on <strong>each page π«</strong>{" "}- </li>- <li>See who viewed your documents</li>- <li>Capture email </li>- <li>Receive feedback</li>- <li>Ask questions and get answers</li>- </ul>- {/* <Text className="text-sm">- (All Notion changes are instantly reflected in shared documents)- </Text> */}- </Text>+ <ul className="list-inside list-disc text-sm">+ <li>+ Track time on <strong>each page π«</strong>{" "}+ </li>+ <li>See who viewed your documents</li>+ <li>Capture email </li>+ <li>Receive feedback</li>+ <li>Ask questions and get answers</li>+ </ul>{/* <Text className="text-sm">You can also use Bulk upload</Text> */}<Section className="mb-[32px] mt-[32px] text-center"><Buttondiff --git a/components/emails/onboarding-4.tsx b/components/emails/onboarding-4.tsxindex 5ae4f3b8..82bbffe2 100644--- a/components/emails/onboarding-4.tsx+++ b/components/emails/onboarding-4.tsx@@ -33,22 +33,20 @@ const Onboarding4Email = () => {Look professional with custom branding!</Text><Text className="text-sm">With Papermark you can:</Text>- <Text className="text-sm">- <ul className="list-inside list-disc text-sm">- <li>- Share documnets with your{" "}- <strong>custom domainπ«</strong>{" "}- </li>+ <ul className="list-inside list-disc text-sm">+ <li>+ Share documnets with your{" "}+ <strong>custom domainπ«</strong>{" "}+ </li>- <li>Remove "powered by Papermark"</li>- <li>Add logo and custom colors</li>- <li>Share data room with custom domain</li>- <li>Add banner and custom brand to data rooms</li>- </ul>- <Text className="text-sm">- (Customization for data rooms is seaprate and available in each- data room you create)- </Text>+ <li>Remove "powered by Papermark"</li>+ <li>Add logo and custom colors</li>+ <li>Share data room with custom domain</li>+ <li>Add banner and custom brand to data rooms</li>+ </ul>+ <Text className="text-sm">+ (Customization for data rooms is seaprate and available in each+ data room you create)</Text>{/* <Text className="text-sm">You can also use Bulk upload</Text> */}<Section className="mb-[32px] mt-[32px] text-center">diff --git a/components/emails/slack-integration.tsx b/components/emails/slack-integration.tsxnew file mode 100644index 00000000..fae20413--- /dev/null+++ b/components/emails/slack-integration.tsx@@ -0,0 +1,84 @@+import React from "react";++import {+ Body,+ Button,+ Container,+ Head,+ Hr,+ Html,+ Preview,+ Section,+ Tailwind,+ Text,+} from "@react-email/components";++interface SlackIntegrationEmailProps {+ name: string | null | undefined;+}++const SlackIntegrationEmail = ({ name }: SlackIntegrationEmailProps) => {+ const previewText = `See who viewed your documents in slack in 2 clicks`;++ return (+ <Html>+ <Head />+ <Preview>{previewText}</Preview>+ <Tailwind>+ <Body className="mx-auto my-auto bg-white font-sans">+ <Container className="mx-auto my-10 w-[465px] p-5">+ <Text className="mx-0 mb-8 mt-4 p-0 text-center text-2xl font-normal">+ <span className="font-bold tracking-tighter">Papermark</span>+ </Text>+ <Text className="mx-0 mb-8 mt-4 p-0 text-center text-2xl font-normal">+ Connect Slack in 2 clicks+ </Text>+ <Text className="text-sm">+ Hi{name && ` ${name}`}!+ </Text>+ <Text className="text-sm">+ We offer direct integration to Slack, and it's free for all users for 30 days.+ </Text>+ <Text className="text-sm">+ With our Slack integration, you can get real-time notifications+ about document and data roomviews directly in your Slack channels !+ </Text>+ <Section className="mb-[32px] mt-[32px] text-center">+ <Button+ className="rounded bg-black text-center text-xs font-semibold text-white no-underline"+ href={`${process.env.NEXT_PUBLIC_BASE_URL}/settings/integrations`}+ style={{ padding: "12px 20px" }}+ >+ See who viewed your documents in Slack+ </Button>+ </Section>++ <Text className="text-sm">+ If you have any questions or need help setting it up, just+ respond to this email. I'm always happy to help!+ </Text>+ <Text className="text-sm text-gray-400">Marc from Papermark</Text>+ <Hr />+ <Section className="mt-8 text-gray-400">+ <Text className="text-xs">+ Β© {new Date().getFullYear()}{" "}+ <a+ href="https://www.papermark.com"+ className="text-gray-400 no-underline hover:text-gray-400"+ target="_blank"+ >+ papermark.com+ </a>+ </Text>+ <Text className="text-xs">+ Feel free to always reach out to me or our support team.+ </Text>+ </Section>+ </Container>+ </Body>+ </Tailwind>+ </Html>+ );+};++export default SlackIntegrationEmail;\ No newline at end of filediff --git a/components/emails/thousand-views-congrats.tsx b/components/emails/thousand-views-congrats.tsxnew file mode 100644index 00000000..c59b9cae--- /dev/null+++ b/components/emails/thousand-views-congrats.tsx@@ -0,0 +1,44 @@+import React from "react";++import { Body, Head, Html, Link, Preview, Tailwind, Text } from "@react-email/components";++interface ThousandViewsCongratsEmailProps {+ name: string | null | undefined;+}++const ThousandViewsCongratsEmail = ({ name }: ThousandViewsCongratsEmailProps) => {+ return (+ <Html>+ <Head />+ <Preview>1000 views on Papermark. Awesome, {name}</Preview>+ <Tailwind>+ <Body className="font-sans text-sm">+ <Text>Hi {name},</Text>+ <Text>+ I'm Marc, founder of Papermark. Congrats on 1000 views on your documents.+ </Text>+ <Text>+ How is your experience so far?+ </Text>++ <Text>+ Thanks so much,+ <br />+ Marc+ </Text>+ <Text>+ <Link+ href="https://www.g2.com/products/papermark/reviews"+ target="_blank"+ className="text-blue-500 underline"+ >+ Leave us a G2 review+ </Link>+ </Text>+ </Body>+ </Tailwind>+ </Html>+ );+};++export default ThousandViewsCongratsEmail;\ No newline at end of filediff --git a/components/emails/upgrade-one-month-checkin.tsx b/components/emails/upgrade-one-month-checkin.tsxnew file mode 100644index 00000000..103b8ee8--- /dev/null+++ b/components/emails/upgrade-one-month-checkin.tsx@@ -0,0 +1,37 @@+import React from "react";++import { Body, Head, Html, Preview, Tailwind, Text } from "@react-email/components";++interface UpgradeCheckinEmailProps {+ name: string | null | undefined;+ planName?: string;+}++const UpgradeCheckinEmail = ({ name, planName = "Pro" }: UpgradeCheckinEmailProps) => {+ return (+ <Html>+ <Head />+ <Preview>Check-in from Marc</Preview>+ <Tailwind>+ <Body className="font-sans text-sm">+ <Text>Hi {name},</Text>+ <Text>+ It is Marc here. How has your experience been so far? Are you getting the value you+ expected from the advanced features?+ </Text>++ <Text>+ Any feedback - what's working well, and what could+ we improve?+ </Text>+ <Text>++ Marc+ </Text>+ </Body>+ </Tailwind>+ </Html>+ );+};++export default UpgradeCheckinEmail;\ No newline at end of filediff --git a/components/emails/upgrade-personal-welcome.tsx b/components/emails/upgrade-personal-welcome.tsxnew file mode 100644index 00000000..d437e7cf--- /dev/null+++ b/components/emails/upgrade-personal-welcome.tsx@@ -0,0 +1,36 @@+import React from "react";++import { Body, Head, Html, Preview, Tailwind, Text } from "@react-email/components";++interface UpgradeCongratsEmailProps {+ name: string | null | undefined;+ planName?: string;+}++const UpgradeCongratsEmail = ({ name, planName = "Pro" }: UpgradeCongratsEmailProps) => {+ return (+ <Html>+ <Head />+ <Preview>Welcome to {planName}, {name}!</Preview>+ <Tailwind>+ <Body className="font-sans text-sm">+ <Text>Hi {name},</Text>+ <Text>+ I'm Iuliia, co-founder of Papermark. Thanks for upgrading! I'm thrilled+ to have you on our {planName} plan.+ </Text>+ <Text>+ You now have access to advanced features. Any questions so far??+ </Text>++ <Text>++ Iuliia+ </Text>+ </Body>+ </Tailwind>+ </Html>+ );+};++export default UpgradeCongratsEmail;\ No newline at end of filediff --git a/components/emails/upgrade-plan.tsx b/components/emails/upgrade-plan.tsxindex 12a26828..3fad21f7 100644--- a/components/emails/upgrade-plan.tsx+++ b/components/emails/upgrade-plan.tsx@@ -72,22 +72,11 @@ const UpgradePlanEmail = ({Hey{name && ` ${name}`}!</Text><Text className="text-sm">- My name is Marc, and I'm the founder of Papermark. I wanted+ Marc is here. I wantedto personally reach out to thank you for upgrading to Papermark{" "}{planType}!</Text>- <Text className="text-sm leading-6 text-black">- As you might already know, we are a bootstrapped and{" "}- <Link- href="https://github.com/mfts/papermark"- target="_blank"- className="font-medium text-emerald-500 no-underline"- >- open-source- </Link>{" "}- business. Your support means the world to us and helps us continue- to build and improve Papermark.- </Text>+<Text className="text-sm leading-6 text-black">On the {planType} plan, you now have access to:</Text>diff --git a/components/emails/upgrade-six-month-checkin.tsx b/components/emails/upgrade-six-month-checkin.tsxnew file mode 100644index 00000000..e7f72408--- /dev/null+++ b/components/emails/upgrade-six-month-checkin.tsx@@ -0,0 +1,37 @@+import React from "react";++import { Body, Head, Html, Preview, Tailwind, Text } from "@react-email/components";++interface SixMonthMilestoneEmailProps {+ name: string | null | undefined;+ planName?: string;+}++const SixMonthMilestoneEmail = ({ name, planName = "Pro" }: SixMonthMilestoneEmailProps) => {+ return (+ <Html>+ <Head />+ <Preview>6 months with Papermark</Preview>+ <Tailwind>+ <Body className="font-sans text-sm">+ <Text>Hi {name},</Text>+ <Text>+ What's been your biggest+ win using Papermark?+ </Text>+ <Text>+ Marc here. It's been 6 months since you using advanced Papermark features! Excited to hear your story and feedback for us.+ </Text>+++ <Text>++ Marc+ </Text>+ </Body>+ </Tailwind>+ </Html>+ );+};++export default SixMonthMilestoneEmail;\ No newline at end of filediff --git a/components/emails/viewed-dataroom.tsx b/components/emails/viewed-dataroom.tsxindex 922c41bb..b21c7d3b 100644--- a/components/emails/viewed-dataroom.tsx+++ b/components/emails/viewed-dataroom.tsx@@ -7,6 +7,7 @@ import {Head,Hr,Html,+ Link,Preview,Section,Tailwind,@@ -66,10 +67,19 @@ export default function ViewedDataroom({>See my dataroom insights</Button>- </Section>+ </Section><Text className="text-sm leading-6 text-black">- Stay informed, stay ahead with Papermark.+ Receive view notifications in your{" "}+ <Link+ href="https://app.papermark.com/settings/general"+ className="text-blue-500 underline"+ target="_blank"+ >+ Slack+ </Link>{" "}+ channel. Stay informed, stay ahead with Papermark.</Text>+<Hr /><Section className="mt-8 text-gray-400"><Text className="text-xs">diff --git a/components/emails/viewed-document.tsx b/components/emails/viewed-document.tsxindex e24fee6e..34f5c4d4 100644--- a/components/emails/viewed-document.tsx+++ b/components/emails/viewed-document.tsx@@ -7,6 +7,7 @@ import {Head,Hr,Html,+ Link,Preview,Section,Tailwind,@@ -68,8 +69,17 @@ export default function ViewedDocument({</Button></Section><Text className="text-sm leading-6 text-black">- Stay informed, stay ahead with Papermark.+ Receive view notifications in your{" "}+ <Link+ href="https://app.papermark.com/settings/general"+ className="text-blue-500 underline"+ target="_blank"+ >+ Slack+ </Link>{" "}+ channel. Stay informed, stay ahead with Papermark.</Text>+<Hr /><Section className="mt-8 text-gray-400"><Text className="text-xs">diff --git a/components/emails/welcome.tsx b/components/emails/welcome.tsxindex dc394cb1..1200632b 100644--- a/components/emails/welcome.tsx+++ b/components/emails/welcome.tsx@@ -36,24 +36,22 @@ const WelcomeEmail = ({ name }: WelcomeEmailProps) => {Thanks for signing up{name && `, ${name}`}!</Text><Text className="text-sm">- My name is Marc, and I'm the creator of Papermark β the- open-source DocSend alternative! I'm excited to have you on+ My name is Marc, and I'm the founder of Papermark β the+ open-source DocSend alternative for securely sharing documents and data rooms. I'm excited to have you onboard!</Text><Text className="text-sm">Here are a few things you can do to get started:</Text>- <Text className="text-sm">- <ul className="list-inside list-disc text-sm">- <li>Upload a document</li>- <li>Create a virtual data room</li>- <li>- Share a link{" "}- <span className="italic">(with your custom domain)β¨</span>- </li>- <li>Watch the views come in real-time</li>- </ul>- </Text>+ <ul className="list-inside list-disc text-sm">+ <li>Turn your documents into shareable links</li>+ <li>Create secure virtual data rooms</li>+ <li>+ Share your documents {" "}+ <span className="italic">(with custom domain)β¨</span>+ </li>+ <li>Watch the page by page views come in real-time</li>+ </ul><Section className="mb-[32px] mt-[32px] text-center"><ButtonclassName="rounded bg-black text-center text-xs font-semibold text-white no-underline"@@ -63,45 +61,22 @@ const WelcomeEmail = ({ name }: WelcomeEmailProps) => {Get Started</Button></Section>- <Section>- <Text className="text-sm">- If you would like to keep up to date, you can:- </Text>- <Text className="text-sm">- <ul className="list-inside list-disc text-sm">- <li>- Star the repo on{" "}- <Link- href="https://github.com/mfts/papermark"- target="_blank"- >- GitHub- </Link>- </li>- <li>- Follow the journey on{" "}- <Link href="https://x.com/papermarkio" target="_blank">- </Link>- </li>- <li>- Have a call to talk enterprise{" "}- <Link- href="https://cal.com/marcseitz/papermark"- target="_blank"- >- Book- </Link>- </li>- </ul>- </Text>- </Section>+<Section className="mt-4"><Text className="text-sm">If you have any questions or feedback just respond to this- email. I'm always happy to help!+ email. <Link+ href="https://cal.com/marcseitz/papermark"+ target="_blank"+ >+ Book+ </Link> {" "}a call to talk enterprise. I'm always happy to help!+</Text>- <Text className="text-sm text-gray-400">Marc from Papermark</Text>++ <Text className="text-sm text-gray-400">Marc from Papermark++ </Text></Section><Hr /><Section className="mt-8 text-gray-400">@@ -116,7 +91,26 @@ const WelcomeEmail = ({ name }: WelcomeEmailProps) => {</a></Text><Text className="text-xs">- You will shortly receive the intro to Papermark. Stay tuned.+ <Link href="https://www.papermark.com/customers" target="_blank" className="text-gray-400 text-xs">+ Customer stories+ </Link>+ <Link href="https://x.com/papermarkio" target="_blank" className="text-gray-400 text-xs">+ Β· Twitter+ </Link>+ <Link+ href="https://www.linkedin.com/company/papermarkio"+ target="_blank"+ className="text-gray-400 text-xs"+ >+ Β· LinkedIn+ </Link>+ <Link+ href="https://github.com/mfts/papermark"+ target="_blank"+ className="text-gray-400 text-xs"+ >+ Β· GitHub+ </Link></Text></Section></Container>diff --git a/lib/emails/send-custom-domain-setup.ts b/lib/emails/send-custom-domain-setup.tsnew file mode 100644index 00000000..e7391fc5--- /dev/null+++ b/lib/emails/send-custom-domain-setup.ts@@ -0,0 +1,27 @@+import CustomDomainSetupEmail from "@/components/emails/custom-domain-setup";++import { sendEmail } from "@/lib/resend";++export const sendCustomDomainSetupEmail = async (+ email: string,+ name?: string,+ currentPlan?: string,+ hasAccess?: boolean,+) => {+ const emailTemplate = CustomDomainSetupEmail({+ name: name || "there",+ currentPlan: currentPlan || "Free",+ hasAccess: hasAccess || false,+ });++ try {+ await sendEmail({+ to: email,+ subject: "Your Papermark custom domain set up",+ react: emailTemplate,+ test: process.env.NODE_ENV === "development",+ });+ } catch (e) {+ console.error(e);+ }+};\ No newline at end of filediff --git a/lib/emails/send-dataroom-info.ts b/lib/emails/send-dataroom-info.tsindex 5f753d00..ac15f6ec 100644--- a/lib/emails/send-dataroom-info.ts+++ b/lib/emails/send-dataroom-info.ts@@ -1,4 +1,4 @@-import Onboarding5Email from "@/components/emails/onboarding-5";+import Onboarding5Email from "@/components/emails/data-rooms-information";import { sendEmail } from "@/lib/resend";diff --git a/lib/emails/send-dataroom-trial-24h.ts b/lib/emails/send-dataroom-trial-24h.tsnew file mode 100644index 00000000..6736902a--- /dev/null+++ b/lib/emails/send-dataroom-trial-24h.ts@@ -0,0 +1,25 @@+import TrialEndReminderEmail from "@/components/emails/dataroom-trial-24h";++import { sendEmail } from "@/lib/resend";++export const sendDataroomTrial24hReminderEmail = async (params: {+ email: string;+ name: string;+}) => {+ const { email, name } = params;++ // Schedule the email to be sent 24 hours before trial ends+ // Note: This should be called by a cron job 24 hours before trial expiration++ const emailTemplate = TrialEndReminderEmail({ name });+ try {+ await sendEmail({+ to: email,+ subject: `Your Data Room plan trial expires in 24 hours`,+ react: emailTemplate,+ test: process.env.NODE_ENV === "development",+ });+ } catch (e) {+ console.error(e);+ }+};diff --git a/lib/emails/send-dataroom-trial-end.ts b/lib/emails/send-dataroom-trial-end.tsindex abb1e14c..7a6ac851 100644--- a/lib/emails/send-dataroom-trial-end.ts+++ b/lib/emails/send-dataroom-trial-end.ts@@ -12,7 +12,7 @@ export const sendDataroomTrialEndEmail = async (params: {let subject;emailTemplate = DataroomTrialEnd({ name });- subject = "Your dataroom trial has ended";+ subject = "Your Data Room plan trial has ended";try {await sendEmail({diff --git a/lib/emails/send-hundred-views-congrats.ts b/lib/emails/send-hundred-views-congrats.tsnew file mode 100644index 00000000..213ac0a8--- /dev/null+++ b/lib/emails/send-hundred-views-congrats.ts@@ -0,0 +1,20 @@+import HundredViewsCongratsEmail from "@/components/emails/hundred-views-congrats";++import { sendEmail } from "@/lib/resend";++import { CreateUserEmailProps } from "../types";++export const sendHundredViewsCongratsEmail = async (params: CreateUserEmailProps) => {+ const { name, email } = params.user;+ const emailTemplate = HundredViewsCongratsEmail({ name });+ try {+ await sendEmail({+ to: email as string,+ subject: `100 views on Papermark. Awesome, ${name}`,+ react: emailTemplate,+ test: process.env.NODE_ENV === "development",+ });+ } catch (e) {+ console.error(e);+ }+};\ No newline at end of filediff --git a/lib/emails/send-onboarding.ts b/lib/emails/send-onboarding.tsindex 76b2ab90..9c6a3982 100644--- a/lib/emails/send-onboarding.ts+++ b/lib/emails/send-onboarding.ts@@ -2,7 +2,7 @@ import Onboarding1Email from "@/components/emails/onboarding-1";import Onboarding2Email from "@/components/emails/onboarding-2";import Onboarding3Email from "@/components/emails/onboarding-3";import Onboarding4Email from "@/components/emails/onboarding-4";-import Onboarding5Email from "@/components/emails/onboarding-5";+import Onboarding5Email from "@/components/emails/data-rooms-information";import { sendEmail } from "@/lib/resend";diff --git a/lib/emails/send-slack-integration.ts b/lib/emails/send-slack-integration.tsnew file mode 100644index 00000000..321d5bca--- /dev/null+++ b/lib/emails/send-slack-integration.ts@@ -0,0 +1,25 @@+import SlackIntegrationEmail from "@/components/emails/slack-integration";++import { sendEmail } from "@/lib/resend";++import { CreateUserEmailProps } from "../types";++export const sendSlackIntegrationEmail = async (params: CreateUserEmailProps) => {+ const { name, email } = params.user;++ // Schedule the email to be sent 1 day from now (24 hours)+ const oneDayFromNow = new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString();++ const emailTemplate = SlackIntegrationEmail({ name });+ try {+ await sendEmail({+ to: email as string,+ subject: "See who viewed your documents in Slack ",+ react: emailTemplate,+ test: process.env.NODE_ENV === "development",+ scheduledAt: oneDayFromNow,+ });+ } catch (e) {+ console.error(e);+ }+};\ No newline at end of filediff --git a/lib/emails/send-thousand-views-congrats.ts b/lib/emails/send-thousand-views-congrats.tsnew file mode 100644index 00000000..ce6ae30e--- /dev/null+++ b/lib/emails/send-thousand-views-congrats.ts@@ -0,0 +1,20 @@+import ThousandViewsCongratsEmail from "@/components/emails/thousand-views-congrats";++import { sendEmail } from "@/lib/resend";++import { CreateUserEmailProps } from "../types";++export const sendThousandViewsCongratsEmail = async (params: CreateUserEmailProps) => {+ const { name, email } = params.user;+ const emailTemplate = ThousandViewsCongratsEmail({ name });+ try {+ await sendEmail({+ to: email as string,+ subject: `1000 views on Papermark. Awesome, ${name}`,+ react: emailTemplate,+ test: process.env.NODE_ENV === "development",+ });+ } catch (e) {+ console.error(e);+ }+};\ No newline at end of filediff --git a/lib/emails/send-trial-end-final-reminder.ts b/lib/emails/send-trial-end-final-reminder.tsdeleted file mode 100644index 44c5e503..00000000--- a/lib/emails/send-trial-end-final-reminder.ts+++ /dev/null@@ -1,21 +0,0 @@-import TrialEndFinalReminderEmail from "@/components/emails/trial-end-final-reminder";--import { sendEmail } from "@/lib/resend";--export const sendTrialEndFinalReminderEmail = async (- email: string,- name: string | null,-) => {- const emailTemplate = TrialEndFinalReminderEmail({ name });- try {- await sendEmail({- to: email,- subject: `Your pro trial expires in 24 hours`,- react: emailTemplate,- test: process.env.NODE_ENV === "development",- system: true,- });- } catch (e) {- console.error(e);- }-};diff --git a/lib/emails/send-trial-end-reminder.ts b/lib/emails/send-trial-end-reminder.tsdeleted file mode 100644index fa4c206f..00000000--- a/lib/emails/send-trial-end-reminder.ts+++ /dev/null@@ -1,21 +0,0 @@-import TrialEndReminderEmail from "@/components/emails/trial-end-reminder";--import { sendEmail } from "@/lib/resend";--export const sendTrialEndReminderEmail = async (- email: string,- name: string | null,-) => {- const emailTemplate = TrialEndReminderEmail({ name });- try {- await sendEmail({- to: email,- subject: `Your pro trial is ending soon`,- react: emailTemplate,- test: process.env.NODE_ENV === "development",- system: true,- });- } catch (e) {- console.error(e);- }-};diff --git a/lib/emails/send-upgrade-month-checkin.ts b/lib/emails/send-upgrade-month-checkin.tsnew file mode 100644index 00000000..784d67a3--- /dev/null+++ b/lib/emails/send-upgrade-month-checkin.ts@@ -0,0 +1,29 @@+import UpgradeCheckinEmail from "@/components/emails/upgrade-checkin";++import { sendEmail } from "@/lib/resend";++import { CreateUserEmailProps } from "../types";++export const sendUpgradeCheckinEmail = async (params: CreateUserEmailProps & { planName?: string }) => {+ const { name, email } = params.user;+ const { planName = "Pro" } = params;++ // Schedule the email to be sent 1.5 months from now (45 days)+ const oneAndHalfMonthsFromNow = new Date(Date.now() + 1000 * 60 * 60 * 24 * 45).toISOString();++ // Get the first name from the full name+ const firstName = name ? name.split(" ")[0] : null;++ const emailTemplate = UpgradeCheckinEmail({ name: firstName, planName });+ try {+ await sendEmail({+ to: email as string,+ subject: "Check-in from Marc",+ react: emailTemplate,+ test: process.env.NODE_ENV === "development",+ scheduledAt: oneAndHalfMonthsFromNow,+ });+ } catch (e) {+ console.error(e);+ }+};\ No newline at end of filediff --git a/lib/emails/send-upgrade-personal-welcome.ts b/lib/emails/send-upgrade-personal-welcome.tsnew file mode 100644index 00000000..9a861714--- /dev/null+++ b/lib/emails/send-upgrade-personal-welcome.ts@@ -0,0 +1,29 @@+import UpgradeCongratsEmail from "@/components/emails/upgrade-personal-welcome";++import { sendEmail } from "@/lib/resend";++import { CreateUserEmailProps } from "../types";++export const sendUpgradeCongratsEmail = async (params: CreateUserEmailProps & { planName?: string }) => {+ const { name, email } = params.user;+ const { planName = "Pro" } = params;++ // Schedule the email to be sent 6 minutes from now+ const sixMinuteFromNow = new Date(Date.now() + 1000 * 60 * 6).toISOString();++ // Get the first name from the full name+ const firstName = name ? name.split(" ")[0] : null;++ const emailTemplate = UpgradeCongratsEmail({ name: firstName, planName });+ try {+ await sendEmail({+ to: email as string,+ subject: `Your Papermark account is ready`,+ react: emailTemplate,+ test: process.env.NODE_ENV === "development",+ scheduledAt: sixMinuteFromNow,+ });+ } catch (e) {+ console.error(e);+ }+};\ No newline at end of filediff --git a/lib/emails/send-upgrade-six-months-checkin.ts b/lib/emails/send-upgrade-six-months-checkin.tsnew file mode 100644index 00000000..8e590027--- /dev/null+++ b/lib/emails/send-upgrade-six-months-checkin.ts@@ -0,0 +1,29 @@+import SixMonthMilestoneEmail from "@/components/emails/upgrade-six-month-checkin";++import { sendEmail } from "@/lib/resend";++import { CreateUserEmailProps } from "../types";++export const sendSixMonthMilestoneEmail = async (params: CreateUserEmailProps & { planName?: string }) => {+ const { name, email } = params.user;+ const { planName = "Pro" } = params;++ // Schedule the email to be sent 6.5 months from now (195 days)+ const sixAndHalfMonthsFromNow = new Date(Date.now() + 1000 * 60 * 60 * 24 * 195).toISOString();++ // Get the first name from the full name+ const firstName = name ? name.split(" ")[0] : null;++ const emailTemplate = SixMonthMilestoneEmail({ name: firstName, planName });+ try {+ await sendEmail({+ to: email as string,+ subject: "6 months with Papermark",+ react: emailTemplate,+ test: process.env.NODE_ENV === "development",+ scheduledAt: sixAndHalfMonthsFromNow,+ });+ } catch (e) {+ console.error(e);+ }+};\ No newline at end of file