Skip to content

Commit 7d40218

Browse files
authored
Merge pull request bitfinexcom#457 from ZIMkaRU/refactoring/move-report-emailing-from-rest-ext-sendgrid-to-rest-core-mail
Fix email report sending
2 parents b4e1014 + 15963a3 commit 7d40218

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

test/simulate/mocks-spies/mail.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ function addFunctions (ExtApi) {
99
to,
1010
reportUrl,
1111
fileName
12-
} = msg
12+
} = msg?.payload
1313

14+
if (!msg?.type) return cb(new Error('ERR_API_NO_TYPE'))
1415
if (!lang) return cb(new Error('ERR_API_NO_LANGUAGE'))
1516
if (!to) return cb(new Error('ERR_API_NO_TO'))
1617
if (!reportUrl) return cb(new Error('ERR_API_NO_REPORT_URL'))

workers/loc.api/queue/send-mail/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = (grcBfxReq) => {
1414
signatureS3
1515
} = data ?? {}
1616

17-
const mailOptions = {
17+
const payload = {
1818
lang: language ?? 'en',
1919
to,
2020
reportUrl,
@@ -26,7 +26,7 @@ module.exports = (grcBfxReq) => {
2626
return grcBfxReq({
2727
service: 'rest:core:mail',
2828
action: 'enqueueEmail',
29-
args: [mailOptions]
29+
args: [{ type: 'reportDownloadReady', payload }]
3030
})
3131
})
3232

0 commit comments

Comments
 (0)