mirror of
https://github.com/hanzo-apps/dataroom.git
synced 2026-10-30 14:47:36 +00:00
- Replace all Papermark branding with Hanzo Dataroom - Update metadata, titles, descriptions, OG tags - Update email templates footer and branding - Replace papermark.io/com URLs with dataroom.hanzo.ai - Update powered-by component - Update x-powered-by header - Update legal references to Hanzo AI, Inc. - Update social handles to @hanzoai - Update README, CLA, LICENSE, SECURITY docs
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
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 },
|
|
) => {
|
|
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 Hanzo Dataroom",
|
|
from: "Marc Seitz <[email protected]>",
|
|
react: emailTemplate,
|
|
test: process.env.NODE_ENV === "development",
|
|
scheduledAt: sixAndHalfMonthsFromNow,
|
|
});
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
};
|