From 3d7f4c7c6d6c9c8b478d67ec7ef4fe69e30a2184 Mon Sep 17 00:00:00 2001 From: Marcus von Appen Date: Mon, 12 Sep 2016 17:33:42 +0100 Subject: Bug 1070122 - add option to send test email to Params page --- editparams.cgi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'editparams.cgi') diff --git a/editparams.cgi b/editparams.cgi index 796d80d41..c91235c06 100755 --- a/editparams.cgi +++ b/editparams.cgi @@ -147,6 +147,20 @@ if ($action eq 'save' && $current_module) { delete_token($token); } +if ($cgi->param('save-and-test-mta-params') && + $cgi->request_method() eq "POST") +{ + my $message; + my $mail_template = Bugzilla->template_inner($user->setting('lang')); + $mail_template->process('email/mta-test.txt.tmpl', undef, \$message); + require Bugzilla::Mailer; + + # This will throw all sorts of useful errors if mail is not working + Bugzilla::Mailer::MessageToMTA($message); + + $vars->{'message'} = 'mta_param_tests_run'; +} + $vars->{'token'} = issue_session_token('edit_parameters'); $template->process("admin/params/editparams.html.tmpl", $vars) -- cgit v1.2.3-24-g4f1b