Use File::Share(Dir) for templates
[app-edwardng.git] / lib / App / EdwardNG.pm
index e778d6a20b70f6c065ca5a6f47b1c89a44238976..4da1968ce2ab082321fc2ea5b334252f2ee6767e 100644 (file)
@@ -8,6 +8,7 @@ our $VERSION = '0.001';
 our @EXPORT = qw/process_message/;
 
 use Email::Sender::Simple qw/sendmail/;
+use File::Share qw/dist_file/;
 use File::Slurp qw/read_file/;
 use File::Spec::Functions qw/rel2abs/;
 use Getopt::Long;
@@ -33,7 +34,7 @@ sub mg {
 sub first_part{
        my ($ent) = @_;
        return first_part $ent->parts(0) if $ent->parts;
-       $ent->bodyhandle->as_string
+       stringify [$ent->bodyhandle->as_lines]
 }
 
 sub process_message {
@@ -117,7 +118,7 @@ sub run {
 
        $params{plaintext} = first_part $params{decrypted} if $params{decrypted};
 
-       my $tt = Template->new(INCLUDE_PATH => rel2abs $tmpl_path, 'tmpl');
+       my $tt = Template->new(INCLUDE_PATH => rel2abs $tmpl_path, dist_file 'App-EdwardNG', 'tmpl');
        my $data;
        $tt->process($tmpl, \%params, \$data);
        my $email = MIME::Entity->build(
This page took 0.009853 seconds and 4 git commands to generate.