Skip to content

Commit

Permalink
[v1.0.1] fix: Receipt mail not going to customer
Browse files Browse the repository at this point in the history
  • Loading branch information
tans105 committed Jul 17, 2021
1 parent 962d45b commit 0a41557
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/app/controller/email.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ router.post('/sendEmail', function (req, res) {

if (emailPayload.emailType !== 'feedback') {
const receiptEmailPayload = {
...emailPayload,
emailType: 'receipt',
uuid: dbResponse.id
sendToCustomer: true,
};
promises.push(EmailService.sendEmail(receiptEmailPayload))
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/resources/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"database_integration": true
},
"secret": "todo-app-super-shared-secret",
"version": "v1.0.0"
"version": "v1.0.1"
},
"production": {
"email": {
Expand All @@ -41,6 +41,6 @@
"database_integration": true
},
"secret": "todo-app-super-shared-secret-prod",
"version": "v1.0.0"
"version": "v1.0.1"
}
}
2 changes: 1 addition & 1 deletion src/app/service/email.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
if(emailPayload) {
const mailOptions = {
from: emailConfig.from,
to: emailConfig.to,
to: payload.sendToCustomer ? payload.email : emailConfig.to,
subject: emailPayload.subject,
html: emailPayload.body
};
Expand Down

0 comments on commit 0a41557

Please sign in to comment.