diff --git a/website/common/locales/en/groups.json b/website/common/locales/en/groups.json index 80c0b62865..201a28d123 100644 --- a/website/common/locales/en/groups.json +++ b/website/common/locales/en/groups.json @@ -148,6 +148,7 @@ "invitationsSent": "Invitations sent!", "invitationSent": "Invitation sent!", "inviteAlertInfo2": "Or share this link (copy/paste):", + "inviteLimitReached": "You have already sent the maximum number of email invitations. We have a limit to prevent spamming, however if you would like more, please contact us at <%= techAssistanceEmail %> and we'll be happy to discuss it!", "sendGiftHeading": "Send Gift to <%= name %>", "sendGiftGemsBalance": "From <%= number %> Gems", "sendGiftCost": "Total: $<%= cost %> USD", @@ -270,6 +271,5 @@ "confirmCancelGroupPlan": "Are you sure you want to cancel the group plan and remove its benefits from all members, including their free subscriptions?", "canceledGroupPlan": "Canceled Group Plan", "groupPlanCanceled": "Group Plan will become inactive on", - "purchasedGroupPlanPlanExtraMonths": "You have <%= months %> months of extra group plan credit.", - "inviteLimitReached": "You have already sent the max number of email invites." + "purchasedGroupPlanPlanExtraMonths": "You have <%= months %> months of extra group plan credit." } diff --git a/website/server/controllers/api-v3/groups.js b/website/server/controllers/api-v3/groups.js index e4fcf564bf..6641d07bec 100644 --- a/website/server/controllers/api-v3/groups.js +++ b/website/server/controllers/api-v3/groups.js @@ -1,6 +1,7 @@ import { authWithHeaders } from '../../middlewares/auth'; import Bluebird from 'bluebird'; import _ from 'lodash'; +import nconf from 'nconf'; import { model as Group, basicFields as basicGroupFields, @@ -28,6 +29,7 @@ import shared from '../../../common'; import apiMessages from '../../libs/apiMessages'; const MAX_EMAIL_INVITES_BY_USER = 200; +const TECH_ASSISTANCE_EMAIL = nconf.get('EMAILS:TECH_ASSISTANCE_EMAIL'); /** * @apiDefine GroupBodyInvalid @@ -1058,7 +1060,7 @@ api.inviteToGroup = { req.checkParams('groupId', res.t('groupIdRequired')).notEmpty(); - if (user.invitesSent >= MAX_EMAIL_INVITES_BY_USER) throw new NotAuthorized(res.t('inviteLimitReached')); + if (user.invitesSent >= MAX_EMAIL_INVITES_BY_USER) throw new NotAuthorized(res.t('inviteLimitReached', { techAssistanceEmail: TECH_ASSISTANCE_EMAIL })); let validationErrors = req.validationErrors(); if (validationErrors) throw validationErrors;