summaryrefslogtreecommitdiffstats
path: root/api/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/user.go')
-rw-r--r--api/user.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/api/user.go b/api/user.go
index e1d5e83dd..47464f5a1 100644
--- a/api/user.go
+++ b/api/user.go
@@ -193,7 +193,7 @@ func CreateUser(c *Context, team *model.Team, user *model.User) *model.User {
l4g.Error("Failed to set email verified err=%v", cresult.Err)
}
} else {
- FireAndForgetVerifyEmail(result.Data.(*model.User).Id, ruser.FirstName, ruser.Email, team.DisplayName, c.GetTeamURLFromTeam(team))
+ FireAndForgetVerifyEmail(result.Data.(*model.User).Id, ruser.Nickname, ruser.Email, team.Name, team.DisplayName, c.GetSiteURL(), c.GetTeamURLFromTeam(team))
}
ruser.Sanitize(map[string]bool{})
@@ -223,19 +223,19 @@ func fireAndForgetWelcomeEmail(name, email, teamDisplayName, link string) {
}()
}
-func FireAndForgetVerifyEmail(userId, name, email, teamDisplayName, teamURL string) {
+func FireAndForgetVerifyEmail(userId, userNickname, userEmail, teamName, teamDisplayName, siteURL, teamURL string) {
go func() {
- link := fmt.Sprintf("%s/verify_email?uid=%s&hid=%s", teamURL, userId, model.HashPassword(userId))
+ link := fmt.Sprintf("%s/verify_email?uid=%s&hid=%s&teamname=%s&email=%s", siteURL, userId, model.HashPassword(userId), teamName, userEmail)
subjectPage := NewServerTemplatePage("verify_subject", teamURL)
subjectPage.Props["TeamDisplayName"] = teamDisplayName
bodyPage := NewServerTemplatePage("verify_body", teamURL)
- bodyPage.Props["Nickname"] = name
+ bodyPage.Props["Nickname"] = userNickname
bodyPage.Props["TeamDisplayName"] = teamDisplayName
bodyPage.Props["VerifyUrl"] = link
- if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
+ if err := utils.SendMail(userEmail, subjectPage.Render(), bodyPage.Render()); err != nil {
l4g.Error("Failed to send verification email successfully err=%v", err)
}
}()