summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/user.go14
-rw-r--r--i18n/en.json10
-rw-r--r--templates/welcome_body.html2
3 files changed, 15 insertions, 11 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")
diff --git a/i18n/en.json b/i18n/en.json
index 4198b82af..cce65ebaf 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1589,11 +1589,11 @@
},
{
"id": "api.templates.verify_body.title",
- "translation": "You've joined the {{ .TeamDisplayName }} team"
+ "translation": "You've joined {{ .ServerURL }}"
},
{
"id": "api.templates.verify_subject",
- "translation": "[{{ .TeamDisplayName }} {{ .SiteName }}] Email Verification"
+ "translation": "[{{ .SiteName }}] Email Verification"
},
{
"id": "api.templates.welcome_body.button",
@@ -1605,7 +1605,7 @@
},
{
"id": "api.templates.welcome_body.info2",
- "translation": "You can sign-in to your new team from the web address:"
+ "translation": "You can sign in from:"
},
{
"id": "api.templates.welcome_body.info3",
@@ -1613,11 +1613,11 @@
},
{
"id": "api.templates.welcome_body.title",
- "translation": "You've joined the {{ .TeamDisplayName }} team"
+ "translation": "You've joined {{ .ServerURL }}"
},
{
"id": "api.templates.welcome_subject",
- "translation": "You joined {{ .TeamDisplayName }}"
+ "translation": "You joined {{ .ServerURL }}"
},
{
"id": "api.user.activate_mfa.email_and_ldap_only.app_error",
diff --git a/templates/welcome_body.html b/templates/welcome_body.html
index b5ca9beb3..8dee99cf5 100644
--- a/templates/welcome_body.html
+++ b/templates/welcome_body.html
@@ -29,7 +29,7 @@
<tr>
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
<h2 style="font-weight: normal; margin-top: 25px; line-height: 1.5;">{{.Props.Info2}}</h2>
- <a href="{{.Props.TeamURL}}">{{.Props.TeamURL}}</a>
+ <a href="{{.Props.SiteURL}}">{{.Props.SiteURL}}</a>
<p>{{.Props.Info3}}</p>
</td>
</tr>