summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/command_invite_people.go2
-rw-r--r--api/team.go10
-rw-r--r--cmd/platform/oldcommands.go3
-rw-r--r--cmd/platform/user.go2
4 files changed, 9 insertions, 8 deletions
diff --git a/api/command_invite_people.go b/api/command_invite_people.go
index ca2a2633a..e6ad252f6 100644
--- a/api/command_invite_people.go
+++ b/api/command_invite_people.go
@@ -72,7 +72,7 @@ func (me *InvitePeopleProvider) DoCommand(c *Context, args *model.CommandArgs, m
user = result.Data.(*model.User)
}
- go InviteMembers(team, user.GetDisplayName(), emailList)
+ go InviteMembers(team, user.GetDisplayName(), emailList, c.GetSiteURL())
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: c.T("api.command.invite_people.sent")}
}
diff --git a/api/team.go b/api/team.go
index c17bf87af..dc1790116 100644
--- a/api/team.go
+++ b/api/team.go
@@ -378,7 +378,7 @@ func inviteMembers(c *Context, w http.ResponseWriter, r *http.Request) {
emailList = append(emailList, invite["email"])
}
- InviteMembers(team, user.GetDisplayName(), emailList)
+ InviteMembers(team, user.GetDisplayName(), emailList, c.GetSiteURL())
w.Write([]byte(invites.ToJson()))
}
@@ -640,7 +640,7 @@ func getMyTeamsUnread(c *Context, w http.ResponseWriter, r *http.Request) {
}
}
-func InviteMembers(team *model.Team, senderName string, invites []string) {
+func InviteMembers(team *model.Team, senderName string, invites []string, siteURL string) {
for _, invite := range invites {
if len(invite) > 0 {
senderRole := utils.T("api.team.invite_members.member")
@@ -649,13 +649,13 @@ func InviteMembers(team *model.Team, senderName string, invites []string) {
map[string]interface{}{"SenderName": senderName, "TeamDisplayName": team.DisplayName, "SiteName": utils.ClientCfg["SiteName"]})
bodyPage := utils.NewHTMLTemplate("invite_body", model.DEFAULT_LOCALE)
- bodyPage.Props["SiteURL"] = *utils.Cfg.ServiceSettings.SiteURL
+ bodyPage.Props["SiteURL"] = siteURL
bodyPage.Props["Title"] = utils.T("api.templates.invite_body.title")
bodyPage.Html["Info"] = template.HTML(utils.T("api.templates.invite_body.info",
map[string]interface{}{"SenderStatus": senderRole, "SenderName": senderName, "TeamDisplayName": team.DisplayName}))
bodyPage.Props["Button"] = utils.T("api.templates.invite_body.button")
bodyPage.Html["ExtraInfo"] = template.HTML(utils.T("api.templates.invite_body.extra_info",
- map[string]interface{}{"TeamDisplayName": team.DisplayName, "TeamURL": *utils.Cfg.ServiceSettings.SiteURL + "/" + team.Name}))
+ map[string]interface{}{"TeamDisplayName": team.DisplayName, "TeamURL": siteURL + "/" + team.Name}))
props := make(map[string]string)
props["email"] = invite
@@ -665,7 +665,7 @@ func InviteMembers(team *model.Team, senderName string, invites []string) {
props["time"] = fmt.Sprintf("%v", model.GetMillis())
data := model.MapToJson(props)
hash := model.HashPassword(fmt.Sprintf("%v:%v", data, utils.Cfg.EmailSettings.InviteSalt))
- bodyPage.Props["Link"] = fmt.Sprintf("%s/signup_user_complete/?d=%s&h=%s", *utils.Cfg.ServiceSettings.SiteURL, url.QueryEscape(data), url.QueryEscape(hash))
+ bodyPage.Props["Link"] = fmt.Sprintf("%s/signup_user_complete/?d=%s&h=%s", siteURL, url.QueryEscape(data), url.QueryEscape(hash))
if !utils.Cfg.EmailSettings.SendEmailNotifications {
l4g.Info(utils.T("api.team.invite_members.sending.info"), invite, bodyPage.Props["Link"])
diff --git a/cmd/platform/oldcommands.go b/cmd/platform/oldcommands.go
index 1cf898882..a599fa47e 100644
--- a/cmd/platform/oldcommands.go
+++ b/cmd/platform/oldcommands.go
@@ -319,7 +319,8 @@ func cmdInviteUser() {
}
invites := []string{flagEmail}
- api.InviteMembers(team, user.GetDisplayName(), invites)
+ c := getMockContext()
+ api.InviteMembers(team, user.GetDisplayName(), invites, c.GetSiteURL())
os.Exit(0)
}
diff --git a/cmd/platform/user.go b/cmd/platform/user.go
index 43a00e68d..373274241 100644
--- a/cmd/platform/user.go
+++ b/cmd/platform/user.go
@@ -261,7 +261,7 @@ func inviteUser(email string, team *model.Team, teamArg string) {
CommandPrintErrorln("Can't find team '" + teamArg + "'")
return
}
- api.InviteMembers(team, "Administrator", invites)
+ api.InviteMembers(team, "Administrator", invites, *utils.Cfg.ServiceSettings.SiteURL)
CommandPrettyPrintln("Invites may or may not have been sent.")
}