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

@@ -1,5 +1,5 @@
import { Router } from "express";
import { sendEmailVerification, sendMail } from "modules/mail";
import { sendBannEmail, sendEmailVerification, sendMail, sendTimebannEmail } from "modules/mail";
import { sendPasswordChanged, sendCourseCompletedEmail } from "modules/mail";
const router: Router = Router();
@@ -52,6 +52,21 @@ router.post("/template/:template", async (req, res) => {
return;
}
await sendEmailVerification(to, data.user, data.code);
case "ban-notice":
if (!data.user || !data.staffName) {
res.status(400).json({ error: "Missing ban data" });
return;
}
// Implement ban notice email logic here
await sendBannEmail(to, data.user, data.staffName);
break;
case "timeban-notice":
if (!data.user || !data.staffName) {
res.status(400).json({ error: "Missing timeban data" });
return;
}
await sendTimebannEmail(to, data.user, data.staffName);
break;
default:
res.status(400).json({ error: "Invalid template" });
return;