mirror of
https://github.com/hanzoai/dataroom.git
synced 2026-10-30 18:41:07 +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
34 lines
923 B
TypeScript
34 lines
923 B
TypeScript
import { sendEmail } from "@/lib/resend";
|
|
import { CreateUserEmailProps } from "@/lib/types";
|
|
|
|
import UpgradePlanEmail from "@/components/emails/upgrade-plan";
|
|
|
|
const PLAN_TYPE_MAP = {
|
|
pro: "Pro",
|
|
business: "Business",
|
|
datarooms: "Data Rooms",
|
|
"datarooms-plus": "Data Rooms Plus",
|
|
"datarooms-premium": "Data Rooms Premium",
|
|
};
|
|
|
|
export const sendUpgradePlanEmail = async (
|
|
params: CreateUserEmailProps & { planType: string },
|
|
) => {
|
|
const { name, email } = params.user;
|
|
const { planType } = params;
|
|
const emailTemplate = UpgradePlanEmail({ name, planType });
|
|
|
|
const planTypeText = PLAN_TYPE_MAP[planType as keyof typeof PLAN_TYPE_MAP];
|
|
|
|
try {
|
|
await sendEmail({
|
|
to: email as string,
|
|
subject: `Thank you for upgrading to Hanzo Dataroom ${planTypeText}!`,
|
|
react: emailTemplate,
|
|
test: process.env.NODE_ENV === "development",
|
|
});
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
};
|