feat: Add privacyAccepted and timeSubmitted properties to DB and mailer
This commit is contained in:
@@ -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) => {
|
||||
<li><strong>Email:</strong> ${email}</li>
|
||||
<li><strong>Phone:</strong> ${phone}</li>
|
||||
<li><strong>Contact Method:</strong> ${contactMethod}</li>
|
||||
<li><strong>Privacy Policy Accepted:</strong> ${privacyAccepted}</li>
|
||||
<li><strong>Submission Time:</strong> ${result.rows[0].time_submitted}</li>
|
||||
</ul>
|
||||
<p><strong>Message:</strong></p>
|
||||
<p>${message}</p>
|
||||
|
Reference in New Issue
Block a user