Füge E-Mail-Benachrichtigungen für Sperrungen und zeitlich begrenzte Sperrungen hinzu
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user