Save using email
This commit is contained in:
10
index.js
10
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 <alumnihub@kocoder.xyz>",
|
||||
|
Reference in New Issue
Block a user