441abdb3bcfd97c14aada886108c8c342891aea2
1 let router
= require("express").Router();
2 const access
= require("../utils/access");
3 const sendEmail
= require("../utils/mailer");
4 const params
= require("../config/parameters");
6 // Send a message through contact form
7 router
.post("/messages", access
.ajax
, (req
,res
) => {
8 const from = req
.body
["email"];
9 // Replace potential newline characters in subject
10 const subject
= req
.body
["subject"].replace(/\r?\n|\r/g, " ");
11 const body
= req
.body
["content"];
13 sendEmail(from, params
.mail
.contact
, subject
, body
, err
=> {
18 module
.exports
= router
;