X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=7d104117f209a743f3ddf94cd1085aa4237dd2cd;hb=0452430dac4d639796581be77e8674207653f42b;hp=a603310ae60d80e67b4f98836e09d32c0e1bfa45;hpb=28aa236f554e009b2fc416378717e478992ec715;p=freeside.git diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index a603310ae..7d104117f 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -414,10 +414,18 @@ sub generate_email { $args{'from'} =~ /\@([\w\.\-]+)/ or $1 = 'example.com'; my $content_id = join('.', rand()*(2**32), $$, time). "\@$1"; + my $path = "$FS::UID::conf_dir/conf.$FS::UID::datasrc"; + my $file; + if ( [ -e "$path/logo_". $args{'_template'}. ".png" ] ) { + $file = "$path/logo_". $args{'_template'}. ".png"; + } else { + $file = "$path/logo.png"; + } + my $image = build MIME::Entity 'Type' => 'image/png', 'Encoding' => 'base64', - 'Path' => "$FS::UID::conf_dir/conf.$FS::UID::datasrc/logo.png", + 'Path' => $file, 'Filename' => 'logo.png', 'Content-ID' => "<$content_id>", ; @@ -1760,6 +1768,7 @@ sub print_html { 'terms' => $conf->config('invoice_default_terms') || 'Payable upon receipt', 'cid' => $cid, + 'template' => $template, # 'conf_dir' => "$FS::UID::conf_dir/conf.$FS::UID::datasrc", );