Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(email): include data from headers in email sent events
Browse files Browse the repository at this point in the history
  • Loading branch information
philbooth committed Oct 16, 2018
1 parent 87a22be commit 28a4a53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/senders/email.js
Expand Up @@ -360,7 +360,7 @@ module.exports = function (log, config) {
emailService
})

emailUtils.logEmailEventSent(log, message)
emailUtils.logEmailEventSent(log, Object.assign({}, message, { headers }))

return d.resolve(status)
})
Expand Down
1 change: 1 addition & 0 deletions test/local/senders/email.js
Expand Up @@ -844,6 +844,7 @@ describe(
assert.equal(emailEventLog.args[0].flow_id, 'wibble', 'logs flow id')
assert.equal(emailEventLog.args[0].template, 'verifyLoginEmail', 'logs correct template')
assert.equal(emailEventLog.args[0].type, 'sent', 'logs correct type')
assert.equal(emailEventLog.args[0].locale, 'en')
const mailerSend1 = mockLog.info.getCalls()[1]
assert.equal(mailerSend1.args[0].op, 'mailer.send.1', 'logs mailer.send.1')
assert.equal(mailerSend1.args[0].to, message.email, 'logs sender to email address')
Expand Down

0 comments on commit 28a4a53

Please sign in to comment.