Modified: freeswitch/trunk/contrib/sathieu/email2pdf/email2pdf (15690 => 15691)
--- freeswitch/trunk/contrib/sathieu/email2pdf/email2pdf 2009-11-27 10:21:50 UTC (rev 15690)
+++ freeswitch/trunk/contrib/sathieu/email2pdf/email2pdf 2009-11-27 10:29:54 UTC (rev 15691)
@@ -33,6 +33,10 @@
Prints the manual page and exits.
+=item B<--header>=header.html
+
+Set header file. This file will be processed using Template-Toolkit.
+
=back
=head1 COPYRIGHT AND AUTHORS
@@ -96,6 +100,11 @@
my $email;
my $output_dir;
+
+# options
+my $o_help = 0;
+my $o_man = 0;
+my $o_header = 'header.html';
# =========================================================================== #
sub process_raw
{
@@ -144,7 +153,6 @@
};
# specify input filename, or file handle, text reference, etc.
- my $header_file = 'header.html';
my $content_type = `file --mime-type --brief header.html`;
$content_type =~ s/\s+$//; # trim end whitespace
my $header = '';
@@ -153,7 +161,7 @@
my $template = Template->new($tt_config);
# process input template, substituting variables
- $template->process($header_file, $vars, \$header)
+ $template->process($o_header, $vars, \$header)
|| die $template->error();
process_raw $content_type, $header, 1;
}
@@ -177,11 +185,10 @@
}
# =========================================================================== #
-my $o_help = 0;
-my $o_man = 0;
my $result = GetOptions(
'help|?' => \$o_help,
'man' => \$o_man,
+ 'header=s' => \$o_header,
);
pod2usage(-exitstatus => 0, -verbose => 2) if $o_man;
Added: freeswitch/trunk/contrib/sathieu/email2pdf/header.html (0 => 15691)
--- freeswitch/trunk/contrib/sathieu/email2pdf/header.html (rev 0)
+++ freeswitch/trunk/contrib/sathieu/email2pdf/header.html 2009-11-27 10:29:54 UTC (rev 15691)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+ <head>
+ <title>[% mail.header('Subject') %]</title>
+ </head>
+ <body>
+ <h3>Fax</h3>
+From : [% mail.header('From') %]<br>
+Subject : [% mail.header('Subject') %]<br>
+[% body %]
+</body>
+</html>