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) => {
|
app.post("/post", (req, res) => {
|
||||||
fs.writeFile(
|
fs.writeFile(
|
||||||
`./data/${req.body.firstname}-${req.body.lastname}.json`,
|
`./data/${req.body.email}.json`,
|
||||||
JSON.stringify(req.body),
|
JSON.stringify(req.body),
|
||||||
(err) => {
|
(err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@ -90,6 +90,14 @@ app.post("/post", (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.post("/cancel", (req, res) => {
|
app.post("/cancel", (req, res) => {
|
||||||
|
fs.writeFile(
|
||||||
|
`./data/${req.body.email}.json`,
|
||||||
|
JSON.stringify(req.body),
|
||||||
|
(err) => {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
transporter.sendMail(
|
transporter.sendMail(
|
||||||
{
|
{
|
||||||
from: "Alumnihub <alumnihub@kocoder.xyz>",
|
from: "Alumnihub <alumnihub@kocoder.xyz>",
|
||||||
|
Reference in New Issue
Block a user