added email verification
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Router } from "express";
|
||||
import { sendMail } from "modules/mail";
|
||||
import { sendEmailVerification, sendMail } from "modules/mail";
|
||||
import { sendPasswordChanged, sendCourseCompletedEmail } from "modules/mail";
|
||||
|
||||
const router: Router = Router();
|
||||
@@ -45,6 +45,12 @@ router.post("/template/:template", async (req, res) => {
|
||||
}
|
||||
await sendCourseCompletedEmail(to, data.user, data.event);
|
||||
break;
|
||||
case "email-verification":
|
||||
if (!data.code) {
|
||||
res.status(400).json({ error: "Missing verification code" });
|
||||
return;
|
||||
}
|
||||
await sendEmailVerification(to, data.user, data.code);
|
||||
default:
|
||||
res.status(400).json({ error: "Invalid template" });
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user