feat(metrics): include type of reminder in the email query

This commit is contained in:
Vlad Filippov 2016-06-21 13:11:39 -04:00
Родитель d321bc1c27
Коммит 0ab0ad241f
2 изменённых файлов: 20 добавлений и 1 удалений

Просмотреть файл

@ -466,7 +466,8 @@ module.exports = function (log) {
var query = {
uid: message.uid,
code: message.code
code: message.code,
reminder: message.type
}
var link = this.verificationUrl + '?' + qs.stringify(query)

Просмотреть файл

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var extend = require('util')._extend
var P = require('bluebird')
var test = require('tap').test
@ -249,6 +251,22 @@ P.all(
mailer[type](message)
}
)
} else if (type === 'verificationReminderEmail') {
var reminderMessage = extend(message, {
type: 'customType'
})
test(
'custom reminder types are supported in output for ' + type,
function (t) {
mailer.mailer.sendMail = function (emailConfig) {
t.ok(includes(emailConfig.html, 'reminder=customType'))
t.ok(includes(emailConfig.text, 'reminder=customType'))
t.end()
}
mailer[type](reminderMessage)
}
)
}
}
)