diff --git a/custom/templates/mail/actions/job_failure.tmpl b/custom/templates/mail/actions/job_failure.tmpl new file mode 100644 index 0000000..26815b0 --- /dev/null +++ b/custom/templates/mail/actions/job_failure.tmpl @@ -0,0 +1,33 @@ + + + + + + + +{{$repo_link := HTMLFormat `%s` .Job.Run.Repo.HTMLURL .Job.Run.Repo.FullName}} + +

+ {{.locale.Tr "mail.actions.job_failure_info" .Job.Name}} +

+

+ {{.locale.Tr "mail.actions.job_failure_info_repository" $repo_link}}
+ {{.locale.Tr "mail.actions.job_failure_info_run" .Job.Run.Title .Job.Run.HTMLURL}}
+ {{.locale.Tr "mail.actions.job_failure_info_job" .Job.Name .Link}}
+ {{.locale.Tr "mail.actions.job_failure_info_duration" .Job.Duration}}
+ {{.locale.Tr "mail.actions.job_failure_info_finished" (.Job.Stopped.Format "2006-01-02 15:04:05 -07:00")}} +

+

+ {{.locale.Tr "mail.actions.job_failure_view_results" .Link}} +

+ + + diff --git a/custom/templates/mail/auth/2fa_disabled.tmpl b/custom/templates/mail/auth/2fa_disabled.tmpl new file mode 100644 index 0000000..3f9d379 --- /dev/null +++ b/custom/templates/mail/auth/2fa_disabled.tmpl @@ -0,0 +1,15 @@ + + + + + + +

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


+

{{.locale.Tr "mail.totp_disabled.text_1"}}


+ {{if not .HasWebAuthn}}

{{.locale.Tr "mail.totp_disabled.no_2fa"}}


{{end}} +

{{.locale.Tr "mail.account_security_caution.text_1"}}


+

{{.locale.Tr "mail.account_security_caution.text_2"}}


+ + {{template "common/footer_simple" .}} + + diff --git a/custom/templates/mail/auth/activate.tmpl b/custom/templates/mail/auth/activate.tmpl new file mode 100644 index 0000000..eb7ea5a --- /dev/null +++ b/custom/templates/mail/auth/activate.tmpl @@ -0,0 +1,16 @@ + + + + + + + +{{$activate_url := printf "%suser/activate?code=%s" AppUrl (QueryEscape .Code)}} + +

{{.locale.Tr "mail.activate_account.text_1" (.DisplayName|DotEscape) AppName}}


+

{{.locale.Tr "mail.activate_account.text_2" .ActiveCodeLives}}

{{$activate_url}}


+

{{.locale.Tr "mail.link_not_working_do_paste"}}

+ +

© {{AppName}}

+ + diff --git a/custom/templates/mail/auth/activate_email.tmpl b/custom/templates/mail/auth/activate_email.tmpl new file mode 100644 index 0000000..9ca54d3 --- /dev/null +++ b/custom/templates/mail/auth/activate_email.tmpl @@ -0,0 +1,16 @@ + + + + + + + +{{$activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl (QueryEscape .Code) (QueryEscape .Email)}} + +

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


+

{{.locale.Tr "mail.activate_email.text" .ActiveCodeLives}}

{{$activate_url}}


+

{{.locale.Tr "mail.link_not_working_do_paste"}}

+ +

© {{AppName}}

+ + diff --git a/custom/templates/mail/auth/password_change.tmpl b/custom/templates/mail/auth/password_change.tmpl new file mode 100644 index 0000000..4366b8d --- /dev/null +++ b/custom/templates/mail/auth/password_change.tmpl @@ -0,0 +1,16 @@ + + + + + + + + +

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


+

{{.locale.Tr "mail.password_change.text_1"}}


+

{{.locale.Tr "mail.account_security_caution.text_1"}}


+

{{.locale.Tr "mail.account_security_caution.text_2"}}


+ + {{template "common/footer_simple" .}} + + diff --git a/custom/templates/mail/auth/primary_mail_change.tmpl b/custom/templates/mail/auth/primary_mail_change.tmpl new file mode 100644 index 0000000..d17be19 --- /dev/null +++ b/custom/templates/mail/auth/primary_mail_change.tmpl @@ -0,0 +1,14 @@ + + + + + + +

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


+

{{.locale.Tr "mail.primary_mail_change.text_1" .NewPrimaryMail}}


+

{{.locale.Tr "mail.account_security_caution.text_1"}}


+

{{.locale.Tr "mail.account_security_caution.text_2"}}


+ + {{template "common/footer_simple" .}} + + diff --git a/custom/templates/mail/auth/register_notify.tmpl b/custom/templates/mail/auth/register_notify.tmpl new file mode 100644 index 0000000..d3a668b --- /dev/null +++ b/custom/templates/mail/auth/register_notify.tmpl @@ -0,0 +1,17 @@ + + + + + + + +{{$set_pwd_url := printf "%[1]suser/forgot_password" AppUrl}} + +

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


+

{{.locale.Tr "mail.register_notify.text_1" AppName}}


+

{{.locale.Tr "mail.register_notify.text_2" .Username}}

{{AppUrl}}user/login


+

{{.locale.Tr "mail.register_notify.text_3" $set_pwd_url}}


+ +

© {{AppName}}

+ + diff --git a/custom/templates/mail/auth/removed_security_key.tmpl b/custom/templates/mail/auth/removed_security_key.tmpl new file mode 100644 index 0000000..55c355f --- /dev/null +++ b/custom/templates/mail/auth/removed_security_key.tmpl @@ -0,0 +1,15 @@ + + + + + + +

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


+

{{.locale.Tr "mail.removed_security_key.text_1" .SecurityKeyName}}


+ {{if (not .HasTwoFactor)}}

{{.locale.Tr "mail.removed_security_key.no_2fa"}}


{{end}} +

{{.locale.Tr "mail.account_security_caution.text_1"}}


+

{{.locale.Tr "mail.account_security_caution.text_2"}}


+ + {{template "common/footer_simple" .}} + + diff --git a/custom/templates/mail/auth/reset_passwd.tmpl b/custom/templates/mail/auth/reset_passwd.tmpl new file mode 100644 index 0000000..b85b770 --- /dev/null +++ b/custom/templates/mail/auth/reset_passwd.tmpl @@ -0,0 +1,16 @@ + + + + + + + +{{$recover_url := printf "%suser/recover_account?code=%s" AppUrl (QueryEscape .Code)}} + +

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


+

{{.locale.Tr "mail.reset_password.text" .ResetPwdCodeLives}}

{{$recover_url}}


+

{{.locale.Tr "mail.link_not_working_do_paste"}}

+ +

© {{AppName}}

+ + diff --git a/custom/templates/mail/auth/totp_enrolled.tmpl b/custom/templates/mail/auth/totp_enrolled.tmpl new file mode 100644 index 0000000..9c665e0 --- /dev/null +++ b/custom/templates/mail/auth/totp_enrolled.tmpl @@ -0,0 +1,15 @@ + + + + + + + + +

{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}


+ {{if .HasWebAuthn}}

{{.locale.Tr "mail.totp_enrolled.text_1.has_webauthn"}}

{{else}}

{{.locale.Tr "mail.totp_enrolled.text_1.no_webauthn"}}

{{end}}
+

{{.locale.Tr "mail.account_security_caution.text_1"}}


+

{{.locale.Tr "mail.account_security_caution.text_2"}}


+ {{template "common/footer_simple" .}} + + diff --git a/custom/templates/mail/common/footer_simple.tmpl b/custom/templates/mail/common/footer_simple.tmpl new file mode 100644 index 0000000..baec3e5 --- /dev/null +++ b/custom/templates/mail/common/footer_simple.tmpl @@ -0,0 +1 @@ +

{{AppName}}

diff --git a/custom/templates/mail/issue/assigned.tmpl b/custom/templates/mail/issue/assigned.tmpl new file mode 100644 index 0000000..f8ad62a --- /dev/null +++ b/custom/templates/mail/issue/assigned.tmpl @@ -0,0 +1,28 @@ + + + + + + + +{{$repo_url := HTMLFormat "%s" .Issue.Repo.HTMLURL .Issue.Repo.FullName}} +{{$link := HTMLFormat "#%d" .Link .Issue.Index}} + +

+ {{if .IsPull}} + {{.locale.Tr "mail.issue_assigned.pull" .Doer.Name $link $repo_url}} + {{else}} + {{.locale.Tr "mail.issue_assigned.issue" .Doer.Name $link $repo_url}} + {{end}} +

+ + + diff --git a/custom/templates/mail/issue/default.tmpl b/custom/templates/mail/issue/default.tmpl new file mode 100644 index 0000000..7b0939c --- /dev/null +++ b/custom/templates/mail/issue/default.tmpl @@ -0,0 +1,99 @@ + + + + + + + + + + + {{if .IsMention}}

{{.locale.Tr "mail.issue.x_mentioned_you" .Doer.Name}}

{{end}} + {{if eq .ActionName "push"}} +

+ {{if .Comment.IsForcePush}} + {{$oldCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.OldCommit}} + {{$oldShortSha := ShortSha .Comment.OldCommit}} + {{$oldCommitLink := HTMLFormat "%[2]s" $oldCommitUrl $oldShortSha}} + + {{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.NewCommit}} + {{$newShortSha := ShortSha .Comment.NewCommit}} + {{$newCommitLink := HTMLFormat "%[2]s" $newCommitUrl $newShortSha}} + + {{.locale.Tr "mail.issue.action.force_push" .Doer.Name .Comment.Issue.PullRequest.HeadBranch $oldCommitLink $newCommitLink}} + {{else}} + {{.locale.TrN (len .Comment.Commits) "mail.issue.action.push_1" "mail.issue.action.push_n" .Doer.Name .Comment.Issue.PullRequest.HeadBranch (len .Comment.Commits)}} + {{end}} +

+ {{end}} +

+ {{if eq .ActionName "close"}} + {{if ne .CloseIssueByCommit ""}} + {{$commitUrl := printf "%s/commit/%s" .CloseIssueByCommitInRepo.HTMLURL .CloseIssueByCommit}} + {{$shortSha := ShortSha .CloseIssueByCommit}} + {{$commitLink := HTMLFormat "%[2]s" $commitUrl $shortSha}} + {{$doer := HTMLFormat "@%[1]s" .Doer.Name}} + {{$issue := HTMLFormat "#%[2]d" .Link .Issue.Index}} + {{.locale.Tr "mail.issue.action.close_by_commit" $doer $issue $commitLink}} + {{else}} + {{.locale.Tr "mail.issue.action.close" .Doer.Name .Issue.Index}} + {{end}} + {{else if eq .ActionName "reopen"}} + {{.locale.Tr "mail.issue.action.reopen" .Doer.Name .Issue.Index}} + {{else if eq .ActionName "merge"}} + {{.locale.Tr "mail.issue.action.merge" .Doer.Name .Issue.Index .Issue.PullRequest.BaseBranch}} + {{else if eq .ActionName "approve"}} + {{.locale.Tr "mail.issue.action.approve" .Doer.Name}} + {{else if eq .ActionName "reject"}} + {{.locale.Tr "mail.issue.action.reject" .Doer.Name}} + {{else if eq .ActionName "review"}} + {{.locale.Tr "mail.issue.action.review" .Doer.Name}} + {{else if eq .ActionName "review_dismissed"}} + {{.locale.Tr "mail.issue.action.review_dismissed" .Doer.Name .Comment.Review.Reviewer.Name}} + {{else if eq .ActionName "ready_for_review"}} + {{.locale.Tr "mail.issue.action.ready_for_review" .Doer.Name}} + {{end}} + + {{- if eq .Body ""}} + {{if eq .ActionName "new"}} + {{.locale.Tr "mail.issue.action.new" .Doer.Name .Issue.Index}} + {{end}} + {{else}} + {{.Body}} + {{end -}} + {{- range .ReviewComments}} +


+ {{$.locale.Tr "mail.issue.in_tree_path" .TreePath}} +
+
{{.Patch}}
+
{{.RenderedContent}}
+
+ {{end -}} + {{if eq .ActionName "push"}} + + {{end}} +

+ + + diff --git a/custom/templates/mail/notify/admin_new_user.tmpl b/custom/templates/mail/notify/admin_new_user.tmpl new file mode 100644 index 0000000..1de75fe --- /dev/null +++ b/custom/templates/mail/notify/admin_new_user.tmpl @@ -0,0 +1,20 @@ + + + + + + + + + + + +

{{.Body | SanitizeHTML}}

+ + diff --git a/custom/templates/mail/notify/collaborator.tmpl b/custom/templates/mail/notify/collaborator.tmpl new file mode 100644 index 0000000..6108d40 --- /dev/null +++ b/custom/templates/mail/notify/collaborator.tmpl @@ -0,0 +1,20 @@ + + + + + + + + +

{{.locale.Tr "mail.repo.collaborator.added.text"}} {{.RepoName}}

+ + + diff --git a/custom/templates/mail/notify/repo_transfer.tmpl b/custom/templates/mail/notify/repo_transfer.tmpl new file mode 100644 index 0000000..bc4c4b3 --- /dev/null +++ b/custom/templates/mail/notify/repo_transfer.tmpl @@ -0,0 +1,18 @@ + + + + + + +{{$url := HTMLFormat "%[2]s" .Link .Repo}} + +

{{.Subject}}. + {{.locale.Tr "mail.repo.transfer.body" $url}} +

+

+ --- +
+ {{.locale.Tr "mail.view_it_on" AppName}}. +

+ + diff --git a/custom/templates/mail/release.tmpl b/custom/templates/mail/release.tmpl new file mode 100644 index 0000000..4bde6ce --- /dev/null +++ b/custom/templates/mail/release.tmpl @@ -0,0 +1,60 @@ + + + + + + + + + +{{$release_url := HTMLFormat "%s" .Release.HTMLURL .Release.TagName}} +{{$repo_url := HTMLFormat "%s" .Release.Repo.HTMLURL .Release.Repo.FullName}} + +

+ {{.locale.Tr "mail.release.new.text" .Release.Publisher.Name $release_url $repo_url}} +

+

{{.locale.Tr "mail.release.title" .Release.Title}}

+

+ {{.locale.Tr "mail.release.note"}}
+ {{- if eq .Release.RenderedNote ""}} + {{else}} + {{.Release.RenderedNote}} + {{end -}} +

+

+

+ --- +
+ {{.locale.Tr "mail.release.downloads"}} +

+

+ + + diff --git a/custom/templates/mail/team_invite.tmpl b/custom/templates/mail/team_invite.tmpl new file mode 100644 index 0000000..240342f --- /dev/null +++ b/custom/templates/mail/team_invite.tmpl @@ -0,0 +1,17 @@ + + + + + + + +

{{.locale.Tr "mail.team_invite.text_1" (DotEscape .Inviter.DisplayName) (DotEscape .Team.Name) (DotEscape .Organization.DisplayName)}}

+

{{.locale.Tr "mail.team_invite.text_2"}}

{{.InviteURL}}

+

{{.locale.Tr "mail.link_not_working_do_paste"}}

+ {{if .ExpirationDelay}} +

{{.locale.TrPluralString .ExpirationDelay "mail.team_invite.expiration" .ExpirationDelay}}

+ {{end}} +

{{.locale.Tr "mail.team_invite.text_3" .Invite.Email}}

+

© {{AppName}}

+ +