continued the kita-planer

This commit is contained in:
t.indorf
2026-05-08 14:32:14 +02:00
parent b686e714ff
commit 7aff691803
85 changed files with 9434 additions and 588 deletions
+6 -2
View File
@@ -1,13 +1,14 @@
import type { ReactNode } from "react";
import { Resend } from "resend";
const resend = new Resend(process.env.RESEND_API_KEY);
let resendClient: Resend | null = null;
type SendAppEmailInput = {
to: string | string[];
subject: string;
react: ReactNode;
from?: string;
replyTo?: string | string[];
};
type SendAppEmailResult =
@@ -31,6 +32,7 @@ export async function sendAppEmail({
subject,
react,
from = process.env.EMAIL_FROM,
replyTo,
}: SendAppEmailInput): Promise<SendAppEmailResult> {
if (!process.env.RESEND_API_KEY) {
return {
@@ -47,11 +49,13 @@ export async function sendAppEmail({
}
try {
const { data, error } = await resend.emails.send({
resendClient ??= new Resend(process.env.RESEND_API_KEY);
const { data, error } = await resendClient.emails.send({
from: from!,
to,
subject,
react,
replyTo,
});
if (error) {