Browse Source

Show Sendmail settings on admin config page (#2782)

* Show Sendmail settings on admin config page

* Remove unecessary if statement
Jonas Bröms 1 year ago
parent
commit
4d01ecaef3
2 changed files with 16 additions and 4 deletions
  1. 3 0
      options/locale/locale_en-US.ini
  2. 13 4
      templates/admin/config.tmpl

+ 3 - 0
options/locale/locale_en-US.ini

@@ -1412,6 +1412,9 @@ config.mailer_disable_helo = Disable HELO
1412 1412
 config.mailer_name = Name
1413 1413
 config.mailer_host = Host
1414 1414
 config.mailer_user = User
1415
+config.mailer_use_sendmail = Use Sendmail
1416
+config.mailer_sendmail_path = Sendmail Path
1417
+config.mailer_sendmail_args = Extra arguments to Sendmail
1415 1418
 config.send_test_mail = Send Test Email
1416 1419
 config.test_mail_failed = Failed to send test email to '%s': %v
1417 1420
 config.test_mail_sent = Test email has been sent to '%s'.

+ 13 - 4
templates/admin/config.tmpl

@@ -170,10 +170,19 @@
170 170
 				{{if .MailerEnabled}}
171 171
 					<dt>{{.i18n.Tr "admin.config.mailer_name"}}</dt>
172 172
 					<dd>{{.Mailer.Name}}</dd>
173
-					<dt>{{.i18n.Tr "admin.config.mailer_disable_helo"}}</dt>
174
-					<dd><i class="fa fa{{if .Mailer.DisableHelo}}-check{{end}}-square-o"></i></dd>
175
-					<dt>{{.i18n.Tr "admin.config.mailer_host"}}</dt>
176
-					<dd>{{.Mailer.Host}}</dd>
173
+					{{if not .Mailer.UseSendmail}}
174
+						<dt>{{.i18n.Tr "admin.config.mailer_disable_helo"}}</dt>
175
+						<dd><i class="fa fa{{if .Mailer.DisableHelo}}-check{{end}}-square-o"></i></dd>
176
+						<dt>{{.i18n.Tr "admin.config.mailer_host"}}</dt>
177
+						<dd>{{.Mailer.Host}}</dd>
178
+					{{else}}
179
+						<dt>{{.i18n.Tr "admin.config.mailer_use_sendmail"}}</dt>
180
+						<dd><i class="fa fa-check-square-o"></i></dd>
181
+						<dt>{{.i18n.Tr "admin.config.mailer_sendmail_path"}}</dt>
182
+						<dd>{{.Mailer.SendmailPath}}</dd>
183
+						<dt>{{.i18n.Tr "admin.config.mailer_sendmail_args"}}</dt>
184
+						<dd>{{.Mailer.SendmailArgs}}</dd>
185
+					{{end}}
177 186
 					<dt>{{.i18n.Tr "admin.config.mailer_user"}}</dt>
178 187
 					<dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd><br>
179 188
 					<form class="ui form" action="{{AppSubUrl}}/admin/config/test_mail" method="post">