Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat: update the checking email
Marc Seitze338793a21a3
diff --git a/lib/emails/send-upgrade-month-checkin.ts b/lib/emails/send-upgrade-month-checkin.tsindex b920a778..b2f92b84 100644--- a/lib/emails/send-upgrade-month-checkin.ts+++ b/lib/emails/send-upgrade-month-checkin.ts@@ -19,6 +19,7 @@ export const sendUpgradeOneMonthCheckinEmail = async (await sendEmail({to: email as string,subject: "Check-in from Papermark",+ from: "Marc Seitz <[email protected]>",react: emailTemplate,test: process.env.NODE_ENV === "development",});diff --git a/lib/emails/send-upgrade-six-months-checkin.ts b/lib/emails/send-upgrade-six-months-checkin.tsindex 8e590027..4b1cbadf 100644--- a/lib/emails/send-upgrade-six-months-checkin.ts+++ b/lib/emails/send-upgrade-six-months-checkin.ts@@ -1,24 +1,29 @@-import SixMonthMilestoneEmail from "@/components/emails/upgrade-six-month-checkin";-import { sendEmail } from "@/lib/resend";+import SixMonthMilestoneEmail from "@/components/emails/upgrade-six-month-checkin";+import { CreateUserEmailProps } from "../types";-export const sendSixMonthMilestoneEmail = async (params: CreateUserEmailProps & { planName?: string }) => {+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();-+ const sixAndHalfMonthsFromNow = new Date(+ Date.now() + 1000 * 60 * 60 * 24 * 195,+ ).toISOString();+// Get the first name from the full nameconst firstName = name ? name.split(" ")[0] : null;-+const emailTemplate = SixMonthMilestoneEmail({ name: firstName, planName });try {await sendEmail({to: email as string,subject: "6 months with Papermark",+ from: "Marc Seitz <[email protected]>",react: emailTemplate,test: process.env.NODE_ENV === "development",scheduledAt: sixAndHalfMonthsFromNow,@@ -26,4 +31,4 @@ export const sendSixMonthMilestoneEmail = async (params: CreateUserEmailProps &} catch (e) {console.error(e);}-};\ No newline at end of file+};