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

@@ -56,6 +56,7 @@ import { setStandardName } from "../../../../../../helper/discord";
import { penaltyColumns } from "(app)/admin/penalty/columns";
import { addPenalty, editPenaltys } from "(app)/admin/penalty/actions";
import { reportColumns } from "(app)/admin/report/columns";
import { sendMail, sendMailByTemplate } from "../../../../../../helper/mail";
interface ProfileFormProps {
user: User;
@@ -349,6 +350,12 @@ export const UserPenalties = ({ user }: { user: User }) => {
userId: user.id,
createdUserId: createdUser.id,
});
if (user.email) {
await sendMailByTemplate(user.email, "timeban-notice", {
user,
staffName: createdUser.firstname + " " + createdUser.lastname,
});
}
penaltyTable.current?.refresh();
toast.success("Time-Ban wurde hinzugefügt!");
}}
@@ -370,6 +377,12 @@ export const UserPenalties = ({ user }: { user: User }) => {
userId: user.id,
createdUserId: createdUser.id,
});
if (user.email) {
await sendMailByTemplate(user.email, "ban-notice", {
user,
staffName: createdUser.firstname + " " + createdUser.lastname,
});
}
await editUser(user.id, { isBanned: true });
penaltyTable.current?.refresh();
toast.success("Ban wurde hinzugefügt!");