summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-01-06 09:10:21 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2017-01-06 09:10:21 -0500
commit1ddac9ccf9bf2417cd0b34017fff4d28927eb7c1 (patch)
tree258f05cb63d7d38d999cb42ca86dd43a55250bfd /api
parent657d4101f9a5e04edcbab2d84d6467c18aa395bf (diff)
downloadchat-1ddac9ccf9bf2417cd0b34017fff4d28927eb7c1.tar.gz
chat-1ddac9ccf9bf2417cd0b34017fff4d28927eb7c1.tar.bz2
chat-1ddac9ccf9bf2417cd0b34017fff4d28927eb7c1.zip
Fix SiteURL in join team email (#4979)
Diffstat (limited to 'api')
-rw-r--r--api/command_invite_people.go2
-rw-r--r--api/team.go10
2 files changed, 6 insertions, 6 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"])