From 90b2657ae7f022f0a9fe2ba7199c60d32a36d673 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 3 Aug 2022 00:43:27 +0800 Subject: [PATCH] Fix the admin mailer config display (#20633) --- options/locale/locale_en-US.ini | 9 ++++++--- templates/admin/config.tmpl | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index a774bf92ff..b6f00727ea 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2796,16 +2796,19 @@ config.queue_length = Queue Length config.deliver_timeout = Deliver Timeout config.skip_tls_verify = Skip TLS Verification -config.mailer_config = SMTP Mailer Configuration +config.mailer_config = Mailer Configuration config.mailer_enabled = Enabled -config.mailer_disable_helo = Disable HELO +config.mailer_enable_helo = Enable HELO config.mailer_name = Name -config.mailer_host = Host +config.mailer_protocol = Protocol +config.mailer_smtp_addr = SMTP Addr +config.mailer_smtp_port = SMTP Port config.mailer_user = User config.mailer_use_sendmail = Use Sendmail config.mailer_sendmail_path = Sendmail Path config.mailer_sendmail_args = Extra Arguments to Sendmail config.mailer_sendmail_timeout = Sendmail Timeout +config.mailer_use_dummy = Dummy config.test_email_placeholder = Email (e.g. test@example.com) config.send_test_mail = Send Testing Email config.test_mail_failed = Failed to send a testing email to '%s': %v diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index a55a797262..ccd1029cd8 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -218,12 +218,7 @@ {{if .MailerEnabled}}
{{.locale.Tr "admin.config.mailer_name"}}
{{.Mailer.Name}}
- {{if eq .Mailer.MailerType "smtp"}} -
{{.locale.Tr "admin.config.mailer_disable_helo"}}
-
{{if .DisableHelo}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
-
{{.locale.Tr "admin.config.mailer_host"}}
-
{{.Mailer.Host}}
- {{else if eq .Mailer.MailerType "sendmail"}} + {{if eq .Mailer.Protocol "sendmail"}}
{{.locale.Tr "admin.config.mailer_use_sendmail"}}
{{svg "octicon-check"}}
{{.locale.Tr "admin.config.mailer_sendmail_path"}}
@@ -232,6 +227,18 @@
{{.Mailer.SendmailArgs}}
{{.locale.Tr "admin.config.mailer_sendmail_timeout"}}
{{.Mailer.SendmailTimeout}} {{.locale.Tr "tool.raw_seconds"}}
+ {{else if eq .Mailer.Protocol "dummy"}} +
{{.locale.Tr "admin.config.mailer_use_dummy"}}
+
{{svg "octicon-check"}}
+ {{else}}{{/* SMTP family */}} +
{{.locale.Tr "admin.config.mailer_protocol"}}
+
{{.Mailer.Protocol}}
+
{{.locale.Tr "admin.config.mailer_enable_helo"}}
+
{{if .Mailer.EnableHelo}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
+
{{.locale.Tr "admin.config.mailer_smtp_addr"}}
+
{{.Mailer.SMTPAddr}}
+
{{.locale.Tr "admin.config.mailer_smtp_port"}}
+
{{.Mailer.SMTPPort}}
{{end}}
{{.locale.Tr "admin.config.mailer_user"}}
{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}