summaryrefslogtreecommitdiffstats
path: root/app/team.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-07-10 01:54:25 -0700
committerCarlos Tadeu Panato Junior <ctadeu@gmail.com>2018-07-10 10:54:25 +0200
commit74e5d8ae66186a82e8afdd845a108d6a662751d7 (patch)
treefaeeee70a251b636bae0afb4e60c611e00c2cc6b /app/team.go
parent951e4ad98401e9828b9941224318f105fb15d500 (diff)
downloadchat-74e5d8ae66186a82e8afdd845a108d6a662751d7.tar.gz
chat-74e5d8ae66186a82e8afdd845a108d6a662751d7.tar.bz2
chat-74e5d8ae66186a82e8afdd845a108d6a662751d7.zip
MM-11120 Adding setting to disable email invitations and rate limiting. (#9063)
* Adding setting to disable email invitations. * Adding a setting and rate limiting for email invite sending. * Modifying email rate limit to 20/user/hour * Adding EnableEmailInvitations to client side config and command.
Diffstat (limited to 'app/team.go')
-rw-r--r--app/team.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/team.go b/app/team.go
index beb4b1449..d9f19fab8 100644
--- a/app/team.go
+++ b/app/team.go
@@ -805,6 +805,10 @@ func (a *App) postRemoveFromTeamMessage(user *model.User, channel *model.Channel
}
func (a *App) InviteNewUsersToTeam(emailList []string, teamId, senderId string) *model.AppError {
+ if !*a.Config().ServiceSettings.EnableEmailInvitations {
+ return model.NewAppError("InviteNewUsersToTeam", "api.team.invite_members.disabled.app_error", nil, "", http.StatusNotImplemented)
+ }
+
if len(emailList) == 0 {
err := model.NewAppError("InviteNewUsersToTeam", "api.team.invite_members.no_one.app_error", nil, "", http.StatusBadRequest)
return err
@@ -842,7 +846,7 @@ func (a *App) InviteNewUsersToTeam(emailList []string, teamId, senderId string)
}
nameFormat := *a.Config().TeamSettings.TeammateNameDisplay
- a.SendInviteEmails(team, user.GetDisplayName(nameFormat), emailList, a.GetSiteURL())
+ a.SendInviteEmails(team, user.GetDisplayName(nameFormat), user.Id, emailList, a.GetSiteURL())
return nil
}