Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat: add trial reminder emails
Marc Seitzf8ccb1e538d0
diff --git a/components/emails/trial-end-final-reminder.tsx b/components/emails/trial-end-final-reminder.tsxnew file mode 100644index 00000000..fe29868e--- /dev/null+++ b/components/emails/trial-end-final-reminder.tsx@@ -0,0 +1,96 @@+import React from "react";+import {+ Body,+ Button,+ Container,+ Head,+ Heading,+ Html,+ Preview,+ Section,+ Text,+ Tailwind,+ Link,+ Hr,+} from "@react-email/components";++interface TrialEndFinalReminderEmail {+ name: string | null | undefined;+}++const TrialEndFinalReminderEmail = ({ name }: TrialEndFinalReminderEmail) => {+ const previewText = `The document sharing infrastructure for the modern web`;++ return (+ <Html>+ <Head />+ <Preview>{previewText}</Preview>+ <Tailwind>+ <Body className="bg-white my-auto mx-auto font-sans">+ <Container className="my-10 mx-auto p-5 w-[465px]">+ <Heading className="text-2xl font-normal text-center p-0 mt-4 mb-8 mx-0">+ <span className="font-bold tracking-tighter">Papermark</span>+ </Heading>+ <Heading className="text-xl font-seminbold text-center p-0 mt-4 mb-8 mx-0">+ Your pro trial expires in 24 hours+ </Heading>+ <Text className="text-sm leading-6 text-black">+ Hey{name && ` ${name}`}!+ </Text>+ <Text className="text-sm leading-6 text-black">+ Your Papermark Pro trial expires in 24 hours.{" "}+ <Link+ href={`${process.env.NEXT_PUBLIC_BASE_URL}/settings/billing`}+ >+ Upgrade now+ </Link>{" "}+ to:+ </Text>+ <Text className="ml-1 text-sm leading-4 text-black">+ ◆ Send documents 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>+ <Section className="text-center mt-[32px] mb-[32px]">+ <Button+ pX={20}+ pY={12}+ className="bg-black rounded text-white text-xs font-semibold no-underline text-center"+ href={`${process.env.NEXT_PUBLIC_BASE_URL}/settings/billing`}+ >+ Upgrade now+ </Button>+ </Section>+ <Hr />+ <Section className="mt-8 text-gray-400">+ <Text className="text-xs">+ © {new Date().getFullYear()}{" "}+ <a+ href="https://www.papermark.io"+ className="no-underline text-gray-400 hover:text-gray-400 visited:text-gray-400"+ target="_blank"+ >+ papermark.io+ </a>+ </Text>+ <Text className="text-xs">+ If you have any feedback or questions about this email, simply+ reply to it. I'd love to hear from you!+ </Text>+ </Section>+ </Container>+ </Body>+ </Tailwind>+ </Html>+ );+};++export default TrialEndFinalReminderEmail;diff --git a/components/emails/trial-end-reminder.tsx b/components/emails/trial-end-reminder.tsxnew file mode 100644index 00000000..915547b4--- /dev/null+++ b/components/emails/trial-end-reminder.tsx@@ -0,0 +1,100 @@+import React from "react";+import {+ Body,+ Button,+ Container,+ Head,+ Heading,+ Html,+ Preview,+ Section,+ Text,+ Tailwind,+ Link,+ Hr,+} from "@react-email/components";++interface TrialEndReminderEmail {+ name: string | null | undefined;+}++const TrialEndReminderEmail = ({ name }: TrialEndReminderEmail) => {+ const previewText = `The document sharing infrastructure for the modern web`;++ return (+ <Html>+ <Head />+ <Preview>{previewText}</Preview>+ <Tailwind>+ <Body className="bg-white my-auto mx-auto font-sans">+ <Container className="my-10 mx-auto p-5 w-[465px]">+ <Heading className="text-2xl font-normal text-center p-0 mt-4 mb-8 mx-0">+ <span className="font-bold tracking-tighter">Papermark</span>+ </Heading>+ <Heading className="text-xl font-seminbold text-center p-0 mt-4 mb-8 mx-0">+ Your pro trial is almost over+ </Heading>+ <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+ </Text>+ <Section className="text-center mt-[32px] mb-[32px]">+ <Button+ pX={20}+ pY={12}+ className="bg-black rounded text-white text-xs font-semibold no-underline text-center"+ href={`${process.env.NEXT_PUBLIC_BASE_URL}/settings/billing`}+ >+ Upgrade your plan+ </Button>+ </Section>+ <Section>+ <Text className="text-sm">+ Let me know if you have any questions or feedback. I'm+ always happy to help!+ </Text>+ <Text className="text-sm text-gray-400">Marc from Papermark</Text>+ </Section>+ <Hr />+ <Section className="mt-8 text-gray-400">+ <Text className="text-xs">+ © {new Date().getFullYear()}{" "}+ <a+ href="https://www.papermark.io"+ className="no-underline text-gray-400 hover:text-gray-400 visited:text-gray-400"+ target="_blank"+ >+ papermark.io+ </a>+ </Text>+ <Text className="text-xs">+ If you have any feedback or questions about this email, simply+ reply to it. I'd love to hear from you!+ </Text>+ </Section>+ </Container>+ </Body>+ </Tailwind>+ </Html>+ );+};++export default TrialEndReminderEmail;diff --git a/lib/emails/send-trial-end-final-reminder.ts b/lib/emails/send-trial-end-final-reminder.tsnew file mode 100644index 00000000..b2e04426--- /dev/null+++ b/lib/emails/send-trial-end-final-reminder.ts@@ -0,0 +1,12 @@+import { sendEmail } from "@/lib/resend";+import TrialEndFinalReminderEmail from "@/components/emails/trial-end-final-reminder";++export const sendTrialEndFinalReminderEmail = async (email: string, name: string | null) => {+ const emailTemplate = TrialEndFinalReminderEmail({ name });+ await sendEmail({+ to: email,+ subject: `Your pro trial expires in 24 hours`,+ react: emailTemplate,+ test: process.env.NODE_ENV === "development",+ });+};diff --git a/lib/emails/send-trial-end-reminder.ts b/lib/emails/send-trial-end-reminder.tsnew file mode 100644index 00000000..9f4ad206--- /dev/null+++ b/lib/emails/send-trial-end-reminder.ts@@ -0,0 +1,12 @@+import { sendEmail } from "@/lib/resend";+import TrialEndReminderEmail from "@/components/emails/trial-end-reminder";++export const sendTrialEndReminderEmail = async (email: string, name: string | null) => {+ const emailTemplate = TrialEndReminderEmail({ name });+ await sendEmail({+ to: email,+ subject: `Your pro trial is ending soon`,+ react: emailTemplate,+ test: process.env.NODE_ENV === "development",+ });+};