Skip to content

Node.js based forum software built for the modern web

closes #6347

Andrew Rodrigues5602092de91a
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 @@
</div>
<div class="form-group">
<label>[[admin/settings/user:invite-expiration]]</label>
- <input type="number" class="form-control" data-field="inviteExpiration" placeholder="1">
+ <input type="number" class="form-control" data-field="inviteExpiration" placeholder="7">
<p class="help-block">
[[admin/settings/user:invite-expiration-help]]
</p>
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 @@
<td style="padding: 40px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;">
<h1 style="margin: 0 0 10px 0; font-family: sans-serif; font-size: 24px; line-height: 27px; color: #333333; font-weight: normal;">[[email:greeting_no_name]]</h1>
<p style="margin: 0;">[[email:invitation.text1, {username}, {site_title}]]</p>
+ <p style="margin: 0;">[[email:invitation.text2, {expireDays}]]</p>
</td>
</tr>
<tr>