import { renderTemplate } from "./render.js";

const BASE_URL = process.env.PUBLIC_URL ?? "https://sexy.pivoine.art";

export async function renderVerification(data: {
  token: string;
}): Promise<{ subject: string; html: string }> {
  return {
    subject: "Verify your email address — sexy.pivoine.art",
    html: await renderTemplate("verification", {
      url: `${BASE_URL}/signup/verify?token=${data.token}`,
    }),
  };
}

export async function renderPasswordReset(data: {
  token: string;
}): Promise<{ subject: string; html: string }> {
  return {
    subject: "Reset your password — sexy.pivoine.art",
    html: await renderTemplate("password-reset", {
      url: `${BASE_URL}/password/reset?token=${data.token}`,
    }),
  };
}
