PLT-3384 Improve the "Verify Email" email (#3564)
Этот коммит содержится в:
14
api/user.go
14
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")
|
||||
|
||||
10
i18n/en.json
10
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",
|
||||
|
||||
@@ -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>
|
||||
|
||||
Ссылка в новой задаче
Block a user