Skip to content

Commit

Permalink
Fix - Emails only being sent to forms-formulaires@cds-snc.ca for Stag…
Browse files Browse the repository at this point in the history
…ing and Production (#159)
  • Loading branch information
bryan-robitaille authored Dec 22, 2021
1 parent 4ffafba commit 1a2f529
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4
1.0.5
13 changes: 9 additions & 4 deletions aws/app/lambda/reliability/lib/notifyProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ module.exports = async (submissionID, sendReceipt, formSubmission, language, mes
const templateID = "92096ac6-1cc5-40ae-9052-fffdb8439a90";
const notify = new NotifyClient("https://api.notification.canada.ca", process.env.NOTIFY_API_KEY);
const emailBody = convertMessage(formSubmission, language);
const messageSubject = language === "fr" ?
(formSubmission.form.emailSubjectFr ? formSubmission.form.emailSubjectFr : formSubmission.form.titleFr) :
(formSubmission.form.emailSubjectEn ? formSubmission.form.emailSubjectEn : formSubmission.form.titleEn)
const messageSubject =
language === "fr"
? formSubmission.form.emailSubjectFr
? formSubmission.form.emailSubjectFr
: formSubmission.form.titleFr
: formSubmission.form.emailSubjectEn
? formSubmission.form.emailSubjectEn
: formSubmission.form.titleEn;

// Need to get this from the submission now.. not the app.
const submissionFormat = formSubmission.submission;
Expand All @@ -37,7 +42,7 @@ module.exports = async (submissionID, sendReceipt, formSubmission, language, mes

return await notify
// Send to static email address and not submission address in form
.sendEmail(templateID, "forms-formulaires@cds-snc.ca", {
.sendEmail(templateID, submissionFormat.email, {
personalisation: {
subject: messageSubject,
formResponse: emailBody,
Expand Down

0 comments on commit 1a2f529

Please sign in to comment.