diff --git a/public/language/en-GB/email.json b/public/language/en-GB/email.json index f8a083bebd..9825679b0c 100644 --- a/public/language/en-GB/email.json +++ b/public/language/en-GB/email.json @@ -37,14 +37,13 @@ "digest.subject": "Digest for %1", "digest.title": "Your Daily Digest", - "notif.chat.subject": "New chat message received from %1", - "notif.chat.cta": "Click here to continue the conversation", - "notif.chat.unsub.info": "This chat notification was sent to you due to your subscription settings.", - - "notif.post.cta": "Click here to read the full topic", "notif.post.unsub.info": "This post notification was sent to you due to your subscription settings.", - "notif.cta": "Click here to go to forum", + "notif.cta": "To the forum", + "notif.cta-new-reply": "View Post", + "notif.cta-new-chat": "View Chat", + "notif.test.short": "Testing Notifications", + "notif.test.long": "This is a test of the notifications email. Send help!", "test.text1": "This is a test email to verify that the emailer is set up correctly for your NodeBB.", diff --git a/src/notifications.js b/src/notifications.js index b2078d2928..27b1fb0439 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -241,6 +241,11 @@ function pushToUids(uids, notification, callback) { } function sendEmail(uids, callback) { + // Update CTA messaging (as not all notification types need custom text) + if (['new-reply', 'new-chat'].includes(notification.type)) { + notification['cta-type'] = notification.type; + } + async.eachLimit(uids, 3, function (uid, next) { emailer.send('notification', uid, { path: notification.path, diff --git a/src/socket.io/admin.js b/src/socket.io/admin.js index a8c0537e20..eee514384d 100644 --- a/src/socket.io/admin.js +++ b/src/socket.io/admin.js @@ -279,8 +279,8 @@ SocketAdmin.email.test = function (socket, data, callback) { function (next) { notifications.create({ type: 'test', - bodyShort: '[[admin-settings-email:testing]]', - bodyLong: '[[admin-settings-email:testing.send-help]]', + bodyShort: '[[email:notif.test.short]]', + bodyLong: '[[email:notif.test.long]]', nid: 'uid:' + socket.uid + ':test', path: '/', from: socket.uid, diff --git a/src/views/emails/notification.tpl b/src/views/emails/notification.tpl index 489446e468..f39e81e71f 100644 --- a/src/views/emails/notification.tpl +++ b/src/views/emails/notification.tpl @@ -31,7 +31,7 @@ -     [[email:notif.cta]]     +     [[email:notif.cta-{notification.cta-type}]] →