diff options
author | Marcus von Appen <mva@FreeBSD.org> | 2016-09-12 18:33:42 +0200 |
---|---|---|
committer | Gervase Markham <gerv@mozilla.org> | 2016-09-12 18:33:42 +0200 |
commit | 3d7f4c7c6d6c9c8b478d67ec7ef4fe69e30a2184 (patch) | |
tree | c842bf1b2d5ed1db89ece53da062e03a4de7654f /editparams.cgi | |
parent | a43b2bbd196e4afe9c8d77dc5e4d0b09e1c1f3bd (diff) | |
download | bugzilla-3d7f4c7c6d6c9c8b478d67ec7ef4fe69e30a2184.tar.gz bugzilla-3d7f4c7c6d6c9c8b478d67ec7ef4fe69e30a2184.tar.xz |
Bug 1070122 - add option to send test email to Params page
Diffstat (limited to 'editparams.cgi')
-rwxr-xr-x | editparams.cgi | 14 |
1 files changed, 14 insertions, 0 deletions
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) |