diff options
author | mark <mark> | 2011-05-20 20:19:26 +0000 |
---|---|---|
committer | mark <mark> | 2011-05-20 20:19:26 +0000 |
commit | ca8956946894bf0ab03324f1f80797bf38d0f31e (patch) | |
tree | e5e8ea2252569cbfc3e504a3380029bff87f5e3b /httemplate/view | |
parent | 18c0d8edb8bc38369eb5e3be925ed02f2382a45b (diff) |
logging of template-generated mail, #12809
Diffstat (limited to 'httemplate/view')
-rwxr-xr-x | httemplate/view/cust_msg.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/httemplate/view/cust_msg.html b/httemplate/view/cust_msg.html new file mode 100755 index 000000000..e9baae112 --- /dev/null +++ b/httemplate/view/cust_msg.html @@ -0,0 +1,55 @@ +<& /elements/header-popup.html &> +<TABLE> +<TR><TD>From:</TD><TD><% $cust_msg->env_from %></TD></TR> +<TR><TD>To:</TD><TD><% $env_to %></TD></TR> +% if ( $date ) { +<TR><TD><% $label{$cust_msg->status} %></TD><TD><% $date %></TD></TR> +% } +% if ( $cust_msg->error ) { +<TR><TD>Error:</TD><TD><% encode_entities($cust_msg->error) %></TD></TR> +% } +<TR><TD colspan=2> +<FORM name="myform"> +<SCRIPT type="text/javascript"> +function toggle_display(obj) { + document.getElementById('content-header').style.display = + (obj.value == 'header' ? 'block' : 'none'); + document.getElementById('content-body').style.display = + (obj.value == 'body' ? 'block' : 'none'); +} +</SCRIPT> +<INPUT type="radio" name="what_to_show" onchange="toggle_display(this)" value="header" checked> Header +<INPUT type="radio" name="what_to_show" onchange="toggle_display(this)" value="body"> Body +</FORM> +</TR> +<TR><TD colspan=2 style="text-align:center"> +<TEXTAREA id="content-header" style="font-family:monospace" +readonly=1 cols=80 rows=20> +<% encode_entities($cust_msg->header) %> +</TEXTAREA> +<TEXTAREA id="content-body" style="font-family:monospace;display:none" +readonly=1 cols=80 rows=20> +<% encode_entities($cust_msg->body) %> +</TEXTAREA> +</TD></TR> +</TABLE> + +<& /elements/footer.html &> +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied" if !$curuser->access_right('View customer'); + +my ($custmsgnum) = $cgi->keywords; +$custmsgnum =~ /^(\d+)$/ or die "illegal custmsgnum"; +my $cust_msg = qsearchs('cust_msg', { 'custmsgnum' => $custmsgnum }); +my $date = ''; +$date = time2str('%Y-%m-%d %T', $cust_msg->_date) if ( $cust_msg->_date ); +my $env_to = join('</TD></TR><TR><TD></TD><TD>', split(',', $cust_msg->env_to)); + +my %label = ( + 'sent' => 'Sent:', + 'failed' => 'Attempted: ', + 'prepared' => 'Not sent', +); +</%init> |