From 5602092de91ab11155fcf6cc2ecc495596d6de8e Mon Sep 17 00:00:00 2001 From: Andrew Rodrigues Date: Thu, 8 Mar 2018 12:18:02 -0500 Subject: [PATCH] closes #6347 --- public/language/en-GB/email.json | 1 + src/user/invite.js | 4 +++- src/views/admin/settings/user.tpl | 2 +- src/views/emails/invitation.tpl | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public/language/en-GB/email.json b/public/language/en-GB/email.json index 488af122bd..8351cfcd10 100644 --- a/public/language/en-GB/email.json +++ b/public/language/en-GB/email.json @@ -13,6 +13,7 @@ "welcome.cta": "Click here to confirm your email address", "invitation.text1": "%1 has invited you to join %2", + "invitation.text2": "Your invitation will expire in %1 days.", "invitation.ctr": "Click here to create your account.", "reset.text1": "We received a request to reset your password, possibly because you have forgotten it. If this is not the case, please ignore this email.", diff --git a/src/user/invite.js b/src/user/invite.js index e211a67bc7..a7d6401982 100644 --- a/src/user/invite.js +++ b/src/user/invite.js @@ -60,7 +60,8 @@ module.exports = function (User) { var token = utils.generateUUID(); var registerLink = nconf.get('url') + '/register?token=' + token + '&email=' + encodeURIComponent(email); - var expireIn = (parseInt(meta.config.inviteExpiration, 10) || 1) * 86400000; + var expireDays = (parseInt(meta.config.inviteExpiration, 10) || 7); + var expireIn = expireDays * 86400000; async.waterfall([ function (next) { @@ -93,6 +94,7 @@ module.exports = function (User) { subject: subject, username: username, template: 'invitation', + expireDays: expireDays, }; // Append default data to this email payload diff --git a/src/views/admin/settings/user.tpl b/src/views/admin/settings/user.tpl index 02286cc636..ff4b8269b4 100644 --- a/src/views/admin/settings/user.tpl +++ b/src/views/admin/settings/user.tpl @@ -176,7 +176,7 @@
- +

[[admin/settings/user:invite-expiration-help]]

diff --git a/src/views/emails/invitation.tpl b/src/views/emails/invitation.tpl index da800eebdb..799ac67fd5 100644 --- a/src/views/emails/invitation.tpl +++ b/src/views/emails/invitation.tpl @@ -19,6 +19,7 @@

[[email:greeting_no_name]]

[[email:invitation.text1, {username}, {site_title}]]

+

[[email:invitation.text2, {expireDays}]]