- if (!req.xhr)
- return res.json({errmsg: "Unauthorized access"});
- const from = req.body["email"];
- const subject = req.body["subject"];
- const body = req.body["body"];
- // TODO: sanitize ?
- mailer.send(from, mailer.contact, subject, body, err => {
- if (!!err)
- return res.json({errmsg:err});
- // OK, everything fine
- res.json({}); //ignored
- });
+ if (!req.xhr)
+ return res.json({errmsg: "Unauthorized access"});
+ const from = req.body["email"];
+ const subject = req.body["subject"];
+ const body = req.body["content"];
+
+ // TODO: sanitize ?
+ mailer(from, params.mail.contact, subject, body, err => {
+ if (!!err)
+ return res.json({errmsg:err});
+ // OK, everything fine
+ res.json({}); //ignored
+ });