From 7f0369b0d548e4d62cc0c65e0ad4c65b0981af76 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 18 Feb 2024 19:58:00 +0100 Subject: [PATCH] mail --- src/controllers/userController.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/controllers/userController.ts b/src/controllers/userController.ts index 78d24dd..a099ff0 100644 --- a/src/controllers/userController.ts +++ b/src/controllers/userController.ts @@ -1427,7 +1427,7 @@ export async function GetDemo(req: Request, res: Response) { where: { user_id: process.env.DEMO_ACCOUNT_USER_ID as string, }, - attributes: ["user_id"], + attributes: ["user_id", "email", "language"], }); if (!demoAccount) { @@ -1435,6 +1435,16 @@ export async function GetDemo(req: Request, res: Response) { return res.status(400).send({ err: "invalid request" }); } + rabbitmq.sendEmail( + demoAccount.email, + "dashboardSecurityInfoNewAccountLogin", + demoAccount.language, + { + os: getUserAgentOS(req), + email: demoAccount.email, + } + ); + userLogger.info(demoAccount.user_id, "A demo account was requested"); saveSession(req, res, demoAccount.user_id, true);