Skip to content

Commit

Permalink
Merge pull request #52 from GormFrank/master
Browse files Browse the repository at this point in the history
APPS-52 - Add 3 hidden fields (institution, theme, section)
  • Loading branch information
duboisp authored Jul 2, 2020
2 parents 8fa2e65 + ae8452c commit bcdec8a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions controllers/sendsmtp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bcdec8a

Please sign in to comment.