1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-29 05:38:37 +00:00

Make distinction between DisplayName and Username in email templates (#6495)

* Make distinction between DisplayName and Username in email templates

Store the actual username in the variable named Username and store the
separate DisplayName in another variable. This allows us to access the
actual username when we need, which currently fails if a user has set a
full name.

Fixes #6161

* Use u.Name directly

No need for extra function, also change use in all mail sending
functions here

* Don't include Username when not used
This commit is contained in:
mrsdizzie
2019-04-04 03:52:48 -04:00
committed by Lauris BH
parent 3f4e2d9d37
commit 04003d9dc7
5 changed files with 12 additions and 11 deletions

View File

@@ -2,11 +2,11 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{.Username}}, please activate your account</title>
<title>{{.DisplayName}}, please activate your account</title>
</head>
<body>
<p>Hi <b>{{.Username}}</b>, thanks for registering at {{AppName}}!</p>
<p>Hi <b>{{.DisplayName}}</b>, thanks for registering at {{AppName}}!</p>
<p>Please click the following link to activate your account within <b>{{.ActiveCodeLives}}</b>:</p>
<p><a href="{{AppUrl}}user/activate?code={{.Code}}">{{AppUrl}}user/activate?code={{.Code}}</a></p>
<p>Not working? Try copying and pasting it to your browser.</p>