mirror of
https://github.com/HabitRPG/habitica.git
synced 2026-04-21 19:38:58 -05:00
change error message for sending too many invitations to instruct them to email us
This commit is contained in:
@@ -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."
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user