Füge E-Mail-Benachrichtigungen für Sperrungen und zeitlich begrenzte Sperrungen hinzu
This commit is contained in:
@@ -3,6 +3,8 @@ import nodemailer from "nodemailer";
|
||||
import { renderCourseCompleted } from "./mail-templates/CourseCompleted";
|
||||
import { renderPasswordChanged } from "./mail-templates/PasswordChanged";
|
||||
import { renderVerificationCode } from "./mail-templates/ConfirmEmail";
|
||||
import { renderBannNotice } from "modules/mail-templates/Bann";
|
||||
import { renderTimeBanNotice } from "modules/mail-templates/TimeBann";
|
||||
|
||||
let transporter: nodemailer.Transporter | null = null;
|
||||
|
||||
@@ -55,6 +57,22 @@ export const sendEmailVerification = async (to: string, user: User, code: string
|
||||
await sendMail(to, "Bestätige deine E-Mail-Adresse", emailHtml);
|
||||
};
|
||||
|
||||
export const sendBannEmail = async (to: string, user: User, staffName: string) => {
|
||||
const emailHtml = await renderBannNotice({
|
||||
user,
|
||||
staffName,
|
||||
});
|
||||
await sendMail(to, "Deine Sperrung bei Virtual Air Rescue", emailHtml);
|
||||
};
|
||||
|
||||
export const sendTimebannEmail = async (to: string, user: User, staffName: string) => {
|
||||
const emailHtml = await renderTimeBanNotice({
|
||||
user,
|
||||
staffName,
|
||||
});
|
||||
await sendMail(to, "Deine vorrübergehende Sperrung bei Virtual Air Rescue", emailHtml);
|
||||
};
|
||||
|
||||
export const sendMail = async (to: string, subject: string, html: string) =>
|
||||
new Promise<void>(async (resolve, reject) => {
|
||||
if (!transporter) {
|
||||
|
||||
Reference in New Issue
Block a user