diff --git a/src/notifications.js b/src/notifications.js index e3d1a6b0db..69b3822e35 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -65,6 +65,9 @@ Notifications.getMultiple = async function (nids) { notifications.forEach(function (notification, index) { if (notification) { + if (notification.path && !notification.path.startsWith('http')) { + notification.path = nconf.get('relative_path') + notification.path; + } notification.datetimeISO = utils.toISOString(notification.datetime); if (notification.bodyLong) { @@ -168,6 +171,7 @@ async function pushToUids(uids, notification) { await async.eachLimit(uids, 3, function (uid, next) { emailer.send('notification', uid, { path: notification.path, + notification_url: notification.path.startsWith('http') ? notification.path : nconf.get('url') + notification.path, subject: utils.stripHTMLTags(notification.subject || '[[notifications:new_notification]]'), intro: utils.stripHTMLTags(notification.bodyShort), body: notification.bodyLong || '', diff --git a/src/user/digest.js b/src/user/digest.js index 7fdfa764cb..e35db90b49 100644 --- a/src/user/digest.js +++ b/src/user/digest.js @@ -81,9 +81,12 @@ Digest.send = async function (data) { return; } - notifications.forEach(function (notification) { - if (notification.image && !notification.image.startsWith('http')) { - notification.image = nconf.get('url') + notification.image; + notifications.forEach(function (n) { + if (n.image && !n.image.startsWith('http')) { + n.image = nconf.get('base_url') + n.image; + } + if (n.path) { + n.notification_url = n.path.startsWith('http') ? n.path : nconf.get('base_url') + n.path; } }); diff --git a/src/views/emails/digest.tpl b/src/views/emails/digest.tpl index 1f1de51d4e..424748406b 100644 --- a/src/views/emails/digest.tpl +++ b/src/views/emails/digest.tpl @@ -33,7 +33,7 @@
| - + |