diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index d9f97ce549..4462971e00 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -205,14 +205,14 @@ function renderDigestAvatar(block) { if (block.teaser) { if (block.teaser.user.picture) { - return ''; + return ''; } - return '
' + block.teaser.user['icon:text'] + '
'; + return '
' + block.teaser.user['icon:text'] + '
'; } if (block.user.picture) { - return ''; + return ''; } - return '
' + block.user['icon:text'] + '
'; + return '
' + block.user['icon:text'] + '
'; } function userAgentIcons(data) { diff --git a/src/emailer.js b/src/emailer.js index 9c9311d875..672d8605c9 100644 --- a/src/emailer.js +++ b/src/emailer.js @@ -204,7 +204,9 @@ Emailer.send = function (template, uid, params, callback) { params.rtl = await translator.translate('[[language:dir]]', results.settings.userLang) === 'rtl'; Emailer.sendToEmail(template, results.email, results.settings.userLang, params, function () {}); }, - ], callback); + ], function (err) { + return callback(err); + }); }; Emailer.sendToEmail = function (template, email, language, params, callback) { diff --git a/src/views/emails/digest.tpl b/src/views/emails/digest.tpl index c24c7fbd9a..2f5fda8b5a 100644 --- a/src/views/emails/digest.tpl +++ b/src/views/emails/digest.tpl @@ -27,9 +27,9 @@ - + -
{notifications.user.icon:text}
+
{notifications.user.icon:text}
diff --git a/test/template-helpers.js b/test/template-helpers.js index 072d372717..7090683c3c 100644 --- a/test/template-helpers.js +++ b/test/template-helpers.js @@ -179,28 +179,28 @@ describe('helpers', function () { it('should render digest avatar', function (done) { var block = { teaser: { user: { username: 'baris', picture: '/uploads/1.png' } } }; var html = helpers.renderDigestAvatar(block); - assert.equal(html, ''); + assert.equal(html, ''); done(); }); it('should render digest avatar', function (done) { var block = { teaser: { user: { username: 'baris', 'icon:text': 'B', 'icon:bgColor': '#ff000' } } }; var html = helpers.renderDigestAvatar(block); - assert.equal(html, '
' + block.teaser.user['icon:text'] + '
'); + assert.equal(html, '
' + block.teaser.user['icon:text'] + '
'); done(); }); it('should render digest avatar', function (done) { var block = { user: { username: 'baris', picture: '/uploads/1.png' } }; var html = helpers.renderDigestAvatar(block); - assert.equal(html, ''); + assert.equal(html, ''); done(); }); it('should render digest avatar', function (done) { var block = { user: { username: 'baris', 'icon:text': 'B', 'icon:bgColor': '#ff000' } }; var html = helpers.renderDigestAvatar(block); - assert.equal(html, '
' + block.user['icon:text'] + '
'); + assert.equal(html, '
' + block.user['icon:text'] + '
'); done(); });