From ae8452c9bb95c1df9c58b5b134244f8dfab1be2a Mon Sep 17 00:00:00 2001 From: Francis Gorman Date: Tue, 30 Jun 2020 16:26:33 -0400 Subject: [PATCH] APPS-52 - Add 3 hidden fields (institution, theme, section) --- controllers/sendsmtp.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/controllers/sendsmtp.js b/controllers/sendsmtp.js index a930147..bd99a6f 100644 --- a/controllers/sendsmtp.js +++ b/controllers/sendsmtp.js @@ -15,7 +15,7 @@ const ObjectId = require('mongodb').ObjectId; const processEnv = process.env, _devLog = !!!processEnv.prodNoLog, _keySalt = processEnv.keySalt || "5417", - _errorPage = processEnv.errorPage || "https://canada.ca", + _errorPage = processEnv.errorPage || "https://www.canada.ca", _successJSO = processEnv.successJSO || { statusCode: 200, ok: 1 }, _cErrorsJSO = processEnv.cErrorsJSO || { statusCode: 400, bad: 1, msg: "Bad request" }, _sErrorsJSO = processEnv.sErrorsJSO || { statusCode: 500, err: 1 }, @@ -78,20 +78,23 @@ exports.sendMailPOST = async ( req, res, next ) => { } // Get the topic - const topic = await getTopicSMTP( topicId ); + const topic = await getTopicSMTP( topicId ); try { const timestamp = currDate, to = topic.to || reqbody.emailTo; - // Define custom template fields + // Define custom template fields let customFields = { + timestamp: timestamp, pageTitle: reqbody.pageTitle, submissionPage: reqbody.submissionPage, helpful: reqbody.helpful, problem: reqbody.problem, details: reqbody.details, - timestamp: timestamp + institution: reqbody.institutionopt, + theme: reqbody.themeopt, + section: reqbody.sectionopt }; // No topic = no good