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 ",