1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-18 22:58:14 +00:00

Refactor and update mail templates (#35150)

- Moved mail templates to new directories.
- Added new devtest ymls.
- Embedded styles as much as possible.
- Added new translation keys for actions email.

---------

Signed-off-by: NorthRealm <155140859+NorthRealm@users.noreply.github.com>
Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
NorthRealm
2025-09-05 11:20:42 +08:00
committed by GitHub
parent 5fe3296055
commit 07347634aa
29 changed files with 169 additions and 124 deletions

View File

@@ -0,0 +1,13 @@
Inviter:
DisplayName: Inviter Display Name
Team:
Name: Team name
Organization:
DisplayName: Organization Display Name
InviteURL: http://localhost/org/team/invite
Invite:
Email: invited@example.com

View File

@@ -10,6 +10,6 @@
<p>{{.locale.Tr "mail.link_not_working_do_paste"}}</p>
<p>{{.locale.Tr "mail.team_invite.text_3" .Invite.Email}}</p>
<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
<p>© <a href="{{AppUrl}}">{{AppName}}</a></p>
</body>
</html>

View File

@@ -1,10 +1,10 @@
RunStatusText: run status text ....
RunStatusText: Jobs status aggregation
Repo:
FullName: RepoName
FullName: Repo/Name
Run:
WorkflowID: WorkflowID
WorkflowID: workflow.yml
HTMLURL: http://localhost/run/1
Jobs:
@@ -12,7 +12,9 @@ Jobs:
Status: success
Attempt: 1
HTMLURL: http://localhost/job/1
Duration: 1h2m3s
- Name: Job-Name-2
Status: failed
Status: failure
Attempt: 2
HTMLURL: http://localhost/job/2
Duration: 1h2m3s

View File

@@ -15,7 +15,7 @@
{{range $job := .Jobs}}
<li style="background-color: #ffffff; border: 1px solid #ddd; border-radius: 6px; padding: 12px 16px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); transition: box-shadow 0.2s ease;">
<a href="{{$job.HTMLURL}}" style="color: #0073e6; text-decoration: none; font-weight: bold;">
{{$job.Status}}: {{$job.Name}}{{if gt $job.Attempt 1}}, Attempt #{{$job.Attempt}}{{end}}
{{$job.Status}}: {{$job.Name}}{{if gt $job.Attempt 1}}, Attempt #{{$job.Attempt}}{{end}}, {{$job.Duration}}
</a>
</li>
{{end}}

View File

@@ -0,0 +1,3 @@
Subject: Collaborator added
Link: http://localhost
RepoName: Repo/Name

View File

@@ -1,16 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<style>
.footer { font-size:small; color:#666;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{{.Subject}}</title>
</head>
<body>
<p>{{.locale.Tr "mail.repo.collaborator.added.text"}} <code>{{.RepoName}}</code></p>
<div class="footer">
<div style="font-size:small; color:#666;">
<p>
---
<br>

View File

@@ -0,0 +1,11 @@
Subject: Issue assigned
Link: http://localhost
Issue:
Index: 1
Repo:
FullName: Repo/Name
HTMLURL: http://localhost/issue
Doer:
Name: DoerName

View File

@@ -1,9 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<style>
.footer { font-size:small; color:#666;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{{.Subject}}</title>
</head>
@@ -18,7 +15,7 @@
{{.locale.Tr "mail.issue_assigned.issue" .Doer.Name $link $repo_url}}
{{end}}
</p>
<div class="footer">
<div style="font-size:small; color:#666;">
<p>
---
<br>

View File

@@ -0,0 +1 @@
CanReply: true

View File

@@ -6,11 +6,6 @@
<style>
blockquote { padding-left: 1em; margin: 1em 0; border-left: 1px solid grey; color: #777}
.footer { font-size:small; color:#666;}
{{if .ReviewComments}}
.review { padding-left: 1em; margin: 1em 0; }
.review > pre { padding: 1em; border-left: 1px solid grey; }
{{end}}
</style>
</head>
@@ -63,8 +58,8 @@
{{- range .ReviewComments}}
<hr>
{{$.locale.Tr "mail.issue.in_tree_path" .TreePath}}
<div class="review">
<pre>{{.Patch}}</pre>
<div style="padding-left: 1em; margin: 1em 0;">
<pre style="padding: 1em; border-left: 1px solid grey;">{{.Patch}}</pre>
<div>{{.RenderedContent}}</div>
</div>
{{end -}}
@@ -80,12 +75,12 @@
</ul>
{{end}}
</p>
<div class="footer">
<p>
---
<br>
<a href="{{.Link}}">{{.locale.Tr "mail.view_it_on" AppName}}</a>{{if .CanReply}} {{.locale.Tr "mail.reply"}}{{end}}.
</p>
<div style="font-size:small; color:#666;">
<p>
---
<br>
<a href="{{.Link}}">{{.locale.Tr "mail.view_it_on" AppName}}</a>{{if .CanReply}}&nbsp;{{.locale.Tr "mail.reply"}}{{end}}.
</p>
</div>
</body>
</html>

View File

@@ -6,7 +6,6 @@
<style>
blockquote { padding-left: 1em; margin: 1em 0; border-left: 1px solid grey; color: #777}
.footer { font-size:small; color:#666;}
</style>
</head>
@@ -50,12 +49,12 @@
{{end}}
</ul>
</p>
<div class="footer">
<p>
---
<br>
<a href="{{.Link}}">{{.locale.Tr "mail.view_it_on" AppName}}</a>.
</p>
<div style="font-size:small; color:#666;">
<p>
---
<br>
<a href="{{.Link}}">{{.locale.Tr "mail.view_it_on" AppName}}</a>.
</p>
</div>
</body>
</html>

View File

@@ -0,0 +1,3 @@
Subject: Repository transfer
Link: http://localhost
Repo: Repo/Name

View File

@@ -10,10 +10,12 @@
<p>{{.Subject}}.
{{.locale.Tr "mail.repo.transfer.body" $url}}
</p>
<p>
---
<br>
<a href="{{.Link}}">{{.locale.Tr "mail.view_it_on" AppName}}</a>.
</p>
<div style="font-size:small; color:#666;">
<p>
---
<br>
<a href="{{.Link}}">{{.locale.Tr "mail.view_it_on" AppName}}</a>.
</p>
</div>
</body>
</html>

View File

@@ -12,6 +12,6 @@
<p>{{.locale.Tr "mail.activate_account.text_2" .ActiveCodeLives}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>
<p>{{.locale.Tr "mail.link_not_working_do_paste"}}</p>
<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
<p>© <a href="{{AppUrl}}">{{AppName}}</a></p>
</body>
</html>

View File

@@ -0,0 +1,4 @@
DisplayName: User Display Name
Code: The-Activation-Code
Email: admin@example.com
ActiveCodeLives: 24h

View File

@@ -12,6 +12,6 @@
<p>{{.locale.Tr "mail.activate_email.text" .ActiveCodeLives}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>
<p>{{.locale.Tr "mail.link_not_working_do_paste"}}</p>
<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
<p>© <a href="{{AppUrl}}">{{AppName}}</a></p>
</body>
</html>

View File

@@ -0,0 +1,2 @@
DisplayName: User Display Name
Username: Username

View File

@@ -13,6 +13,6 @@
<p>{{.locale.Tr "mail.register_notify.text_2" .Username}}</p><p><a href="{{AppUrl}}user/login">{{AppUrl}}user/login</a></p><br>
<p>{{.locale.Tr "mail.register_notify.text_3" $set_pwd_url}}</p><br>
<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
<p>© <a href="{{AppUrl}}">{{AppName}}</a></p>
</body>
</html>

View File

@@ -0,0 +1,3 @@
DisplayName: User Display Name
Code: The-Reset-Token
ResetPwdCodeLives: 24h

View File

@@ -12,6 +12,6 @@
<p>{{.locale.Tr "mail.reset_password.text" .ResetPwdCodeLives}}</p><p><a href="{{$recover_url}}">{{$recover_url}}</a></p><br>
<p>{{.locale.Tr "mail.link_not_working_do_paste"}}</p>
<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
<p>© <a href="{{AppUrl}}">{{AppName}}</a></p>
</body>
</html>