mirror of
https://github.com/hanzo-apps/dataroom.git
synced 2026-10-30 14:47:36 +00:00
29 lines
638 B
TypeScript
29 lines
638 B
TypeScript
import { sendEmail } from "@/lib/resend";
|
|
|
|
import ExportReady from "@/components/emails/export-ready";
|
|
|
|
export const sendExportReadyEmail = async ({
|
|
to,
|
|
resourceName,
|
|
downloadUrl,
|
|
}: {
|
|
to: string;
|
|
resourceName: string;
|
|
downloadUrl: string;
|
|
}) => {
|
|
const emailTemplate = ExportReady({ resourceName, downloadUrl, email: to });
|
|
|
|
try {
|
|
await sendEmail({
|
|
to,
|
|
subject: `Your ${resourceName} export is ready`,
|
|
react: emailTemplate,
|
|
test: process.env.NODE_ENV === "development",
|
|
system: true,
|
|
});
|
|
} catch (e) {
|
|
console.error("Error sending export ready email:", e);
|
|
throw e;
|
|
}
|
|
};
|