let router = require("express").Router();
const mailer = require(__dirname.replace("/routes", "/utils/mailer"));
let router = require("express").Router();
const mailer = require(__dirname.replace("/routes", "/utils/mailer"));
// Send a message through contact form
router.post("/messages", (req,res,next) => {
if (!req.xhr)
return res.json({errmsg: "Unauthorized access"});
// Send a message through contact form
router.post("/messages", (req,res,next) => {
if (!req.xhr)
return res.json({errmsg: "Unauthorized access"});
- mailer.send(from, mailer.contact, subject, body, err => {
+ mailer(from, params.mail.contact, subject, body, err => {