summaryrefslogtreecommitdiffstats
path: root/api/user.go
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-07-13 13:03:46 -0400
committerCorey Hulen <corey@hulen.com>2016-07-13 09:03:46 -0800
commit0a6bdceccb613d2a9acc88e6c2ada51973b1c78c (patch)
tree64e28742b0a188908899fffdf9cab81823808773 /api/user.go
parent284ee12b2270d7ed86313be613b791d4a30ae46c (diff)
downloadchat-0a6bdceccb613d2a9acc88e6c2ada51973b1c78c.tar.gz
chat-0a6bdceccb613d2a9acc88e6c2ada51973b1c78c.tar.bz2
chat-0a6bdceccb613d2a9acc88e6c2ada51973b1c78c.zip
PLT-3384 Improve the "Verify Email" email (#3564)
Diffstat (limited to 'api/user.go')
-rw-r--r--api/user.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/api/user.go b/api/user.go
index c64315440..846978971 100644
--- a/api/user.go
+++ b/api/user.go
@@ -349,17 +349,19 @@ func CreateOAuthUser(c *Context, w http.ResponseWriter, r *http.Request, service
}
func sendWelcomeEmail(c *Context, userId string, email string, siteURL string, verified bool) {
+ rawUrl, _ := url.Parse(siteURL)
+
subjectPage := utils.NewHTMLTemplate("welcome_subject", c.Locale)
- subjectPage.Props["Subject"] = c.T("api.templates.welcome_subject", map[string]interface{}{"TeamDisplayName": siteURL})
+ subjectPage.Props["Subject"] = c.T("api.templates.welcome_subject", map[string]interface{}{"ServerURL": rawUrl.Host})
bodyPage := utils.NewHTMLTemplate("welcome_body", c.Locale)
bodyPage.Props["SiteURL"] = siteURL
- bodyPage.Props["Title"] = c.T("api.templates.welcome_body.title", map[string]interface{}{"TeamDisplayName": siteURL})
+ bodyPage.Props["Title"] = c.T("api.templates.welcome_body.title", map[string]interface{}{"ServerURL": rawUrl.Host})
bodyPage.Props["Info"] = c.T("api.templates.welcome_body.info")
bodyPage.Props["Button"] = c.T("api.templates.welcome_body.button")
bodyPage.Props["Info2"] = c.T("api.templates.welcome_body.info2")
bodyPage.Props["Info3"] = c.T("api.templates.welcome_body.info3")
- bodyPage.Props["TeamURL"] = siteURL
+ bodyPage.Props["SiteURL"] = siteURL
if !verified {
link := fmt.Sprintf("%s/do_verify_email?uid=%s&hid=%s&email=%s", siteURL, userId, model.HashPassword(userId), url.QueryEscape(email))
@@ -411,13 +413,15 @@ func addDirectChannels(teamId string, user *model.User) {
func SendVerifyEmail(c *Context, userId, userEmail, siteURL string) {
link := fmt.Sprintf("%s/do_verify_email?uid=%s&hid=%s&email=%s", siteURL, userId, model.HashPassword(userId), url.QueryEscape(userEmail))
+ url, _ := url.Parse(siteURL)
+
subjectPage := utils.NewHTMLTemplate("verify_subject", c.Locale)
subjectPage.Props["Subject"] = c.T("api.templates.verify_subject",
- map[string]interface{}{"TeamDisplayName": utils.ClientCfg["SiteName"], "SiteName": utils.ClientCfg["SiteName"]})
+ map[string]interface{}{"SiteName": utils.ClientCfg["SiteName"]})
bodyPage := utils.NewHTMLTemplate("verify_body", c.Locale)
bodyPage.Props["SiteURL"] = siteURL
- bodyPage.Props["Title"] = c.T("api.templates.verify_body.title", map[string]interface{}{"TeamDisplayName": utils.ClientCfg["SiteName"]})
+ bodyPage.Props["Title"] = c.T("api.templates.verify_body.title", map[string]interface{}{"ServerURL": url.Host})
bodyPage.Props["Info"] = c.T("api.templates.verify_body.info")
bodyPage.Props["VerifyUrl"] = link
bodyPage.Props["Button"] = c.T("api.templates.verify_body.button")