diff --git a/controllers/contactController.js b/controllers/contactController.js index e5dacca..0accfa1 100644 --- a/controllers/contactController.js +++ b/controllers/contactController.js @@ -2,13 +2,13 @@ module.exports = (pool, transporter) => { const submitForm = async (req, res) => { - const { firstName, lastName, organization, email, phone, contactMethod, message } = req.body; + const { firstName, lastName, organization, email, phone, contactMethod, message, privacyAccepted } = req.body; try { const result = await pool.query( - `INSERT INTO submissions(first_name, last_name, organization, email, phone, contact_method, message) - VALUES($1, $2, $3, $4, $5, $6, $7) RETURNING *`, - [firstName, lastName, organization, email, phone, contactMethod, message] + `INSERT INTO submissions(first_name, last_name, organization, email, phone, contact_method, message, privacy_accepted, time_submitted) + VALUES($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *`, + [firstName, lastName, organization, email, phone, contactMethod, message, privacyAccepted] ); console.log('Successfully saved submission to the database:', result.rows[0]); @@ -26,6 +26,8 @@ module.exports = (pool, transporter) => {
  • Email: ${email}
  • Phone: ${phone}
  • Contact Method: ${contactMethod}
  • +
  • Privacy Policy Accepted: ${privacyAccepted}
  • +
  • Submission Time: ${result.rows[0].time_submitted}
  • Message:

    ${message}