From 9dc878dba30e6d93ab914f0d2502f3527428b057 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Wed, 23 Dec 2015 21:46:53 -0600 Subject: RT#38217 Send email when logging conditions are met [default template & dump-email_to upgrade] --- httemplate/edit/log_email.html | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'httemplate') diff --git a/httemplate/edit/log_email.html b/httemplate/edit/log_email.html index bbce7c708..709a24069 100644 --- a/httemplate/edit/log_email.html +++ b/httemplate/edit/log_email.html @@ -18,6 +18,7 @@ { 'field' => 'msgnum', 'type' => 'select-msg_template', 'empty_label' => 'Select template', + 'value' => $msgnum, 'required' => 1, }, ], @@ -42,4 +43,14 @@ my %opts = @_; die "access denied" unless $FS::CurrentUser::CurrentUser->access_right([ 'View system logs', 'Configuration' ]); +my $msgnum = $cgi->param('msgnum'); +unless ($msgnum) { + my ($msg_template) = qsearch('msg_template',{ msgname => 'System log' }); + # doesn't seem worth having a config just for the default selected template + # if they've deleted the system-generated one, just default to empty "Select template" + if ($msg_template) { + $msgnum = $msg_template->msgnum; + } +} + -- cgit v1.2.1