From 8117e41dfa1dd162aa98206f46996fa1973e5632 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 16 Jan 2023 21:58:01 +0100 Subject: [PATCH] Add reply hint to mail text (#22459) Addition to #22056 This PR adds a hint to mail text if replies are supported. I can't tell if the text structure is supported in every language. Maybe we need to put the whole line in the translation file and use parameters. --- options/locale/locale_en-US.ini | 1 + services/mailer/mail.go | 1 + templates/mail/issue/default.tmpl | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 8ddd8e40d..1cd4e6a1d 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -365,6 +365,7 @@ password_pwned_err = Could not complete request to HaveIBeenPwned [mail] view_it_on = View it on %s +reply = or reply to this email directly link_not_working_do_paste = Not working? Try copying and pasting it to your browser. hi_user_x = Hi %s, diff --git a/services/mailer/mail.go b/services/mailer/mail.go index 6af4ed249..7c7ad5471 100644 --- a/services/mailer/mail.go +++ b/services/mailer/mail.go @@ -274,6 +274,7 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient "ActionName": actName, "ReviewComments": reviewComments, "Language": locale.Language(), + "CanReply": setting.IncomingEmail.Enabled && commentType != issues_model.CommentTypePullRequestPush, // helper "locale": locale, "Str2html": templates.Str2html, diff --git a/templates/mail/issue/default.tmpl b/templates/mail/issue/default.tmpl index d9f7aff4c..64dbb3df6 100644 --- a/templates/mail/issue/default.tmpl +++ b/templates/mail/issue/default.tmpl @@ -84,7 +84,7 @@

---
- {{.locale.Tr "mail.view_it_on" AppName}}. + {{.locale.Tr "mail.view_it_on" AppName}}{{if .CanReply}} {{.locale.Tr "mail.reply"}}{{end}}.