summaryrefslogtreecommitdiffstats
path: root/cmd/mattermost/commands/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/mattermost/commands/user.go')
-rw-r--r--cmd/mattermost/commands/user.go6
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