diff options
author | cpanato <ctadeu@gmail.com> | 2018-07-10 19:27:14 +0200 |
---|---|---|
committer | cpanato <ctadeu@gmail.com> | 2018-07-10 19:27:14 +0200 |
commit | c042ffa460296587579aff54b157a5109e022f7e (patch) | |
tree | 9e7f77fbc83b6d06204db099066be8999dbb22d9 /cmd/mattermost/commands/user.go | |
parent | 9470564d355c201155f6fcb123152b8ac954f812 (diff) | |
parent | dccd95bc67779a5b83a2660aec0cf4622cd56550 (diff) | |
download | chat-c042ffa460296587579aff54b157a5109e022f7e.tar.gz chat-c042ffa460296587579aff54b157a5109e022f7e.tar.bz2 chat-c042ffa460296587579aff54b157a5109e022f7e.zip |
Merge remote-tracking branch 'upstream/release-5.1' into release-5.1-daily-merge-20180710
Diffstat (limited to 'cmd/mattermost/commands/user.go')
-rw-r--r-- | cmd/mattermost/commands/user.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/mattermost/commands/user.go b/cmd/mattermost/commands/user.go index 373fe7463..b3b43c076 100644 --- a/cmd/mattermost/commands/user.go +++ b/cmd/mattermost/commands/user.go @@ -384,7 +384,11 @@ func inviteUser(a *app.App, email string, team *model.Team, teamArg string) erro return fmt.Errorf("Can't find team '%v'", teamArg) } - a.SendInviteEmails(team, "Administrator", invites, *a.Config().ServiceSettings.SiteURL) + if !*a.Config().ServiceSettings.EnableEmailInvitations { + return fmt.Errorf("Email invites are disabled.") + } + + a.SendInviteEmails(team, "Administrator", "Mattermost CLI "+model.NewId(), invites, *a.Config().ServiceSettings.SiteURL) CommandPrettyPrintln("Invites may or may not have been sent.") return nil |