Add educator email invitations and staff notification preferences

This commit is contained in:
t.indorf
2026-10-08 11:32:38 +02:00
parent 043fed2e46
commit 90b8843cda
15 changed files with 700 additions and 39 deletions
+12 -7
View File
@@ -9,6 +9,7 @@ type SendAppEmailInput = {
react: ReactNode;
from?: string;
replyTo?: string | string[];
idempotencyKey?: string;
};
type SendAppEmailResult =
@@ -36,6 +37,7 @@ export async function sendAppEmail({
react,
from = process.env.EMAIL_FROM,
replyTo,
idempotencyKey,
}: SendAppEmailInput): Promise<SendAppEmailResult> {
if (!process.env.RESEND_API_KEY) {
if (process.env.NODE_ENV === "development") {
@@ -63,13 +65,16 @@ export async function sendAppEmail({
try {
resendClient ??= new Resend(process.env.RESEND_API_KEY);
const { data, error } = await resendClient.emails.send({
from: from!,
to,
subject,
react,
replyTo,
});
const { data, error } = await resendClient.emails.send(
{
from: from!,
to,
subject,
react,
replyTo,
},
{ idempotencyKey },
);
if (error) {
console.error("Resend konnte die E-Mail nicht versenden:", error);