Füge E-Mail-Benachrichtigungen für Sperrungen und zeitlich begrenzte Sperrungen hinzu

This commit is contained in:
PxlLoewe
2025-06-28 00:13:55 -07:00
parent 1a1fab3f58
commit 96fcf7e4a5
12 changed files with 445 additions and 53 deletions

View File

@@ -13,11 +13,16 @@ export const sendMail = async (email: string, subject: string, html: string) =>
export const sendMailByTemplate = async (
email: string,
template: "password-change" | "course-completed" | "email-verification",
template:
| "password-change"
| "course-completed"
| "email-verification"
| "ban-notice"
| "timeban-notice",
data: any,
) => {
try {
const res = await fetch(`${process.env.NEXT_PUBLIC_HUB_SERVER_URL}/mail/template/${template}`, {
await fetch(`${process.env.NEXT_PUBLIC_HUB_SERVER_URL}/mail/template/${template}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
@@ -26,7 +31,6 @@ export const sendMailByTemplate = async (
data,
}),
});
console.log(res);
} catch (error) {
console.error("Error sending mail:", error);
}