From 69fde61cd8322ccf9b1bd355e72d9f25ff9d8dda Mon Sep 17 00:00:00 2001 From: Konstantin Hintermayer Date: Thu, 21 Aug 2025 16:01:18 +0000 Subject: [PATCH] Save using email --- index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 4f210fa..a3c43c8 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,7 @@ app.use(bodyParser.urlencoded({ extended: true })); app.post("/post", (req, res) => { fs.writeFile( - `./data/${req.body.firstname}-${req.body.lastname}.json`, + `./data/${req.body.email}.json`, JSON.stringify(req.body), (err) => { console.log(err); @@ -90,6 +90,14 @@ app.post("/post", (req, res) => { }); app.post("/cancel", (req, res) => { + fs.writeFile( + `./data/${req.body.email}.json`, + JSON.stringify(req.body), + (err) => { + console.log(err); + } + ); + transporter.sendMail( { from: "Alumnihub ",