fix: #7604 shortened CTA text and added custom text for some notifs (#7605)

* fix: #7604 shortened CTA text and added custom text for some notifs

Specifically, new-reply and new-chat have different CTA text as they
do not go to the forum home like other email templates send users to.

* fix: minor optimization as suggested by @barisusakli
This commit is contained in:
Julian Lam
2019-05-16 09:43:06 -04:00
committed by GitHub
parent a41769e61c
commit b32da57faf
4 changed files with 13 additions and 9 deletions

View File

@@ -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,