Merge current features with security hardening and automatic safe initialization

This commit is contained in:
t.indorf
2026-10-09 23:29:19 +02:00
85 changed files with 13522 additions and 1326 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 (Array.isArray(to)) {
let id: string | undefined;
@@ -72,13 +74,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);