diff options
author | ivan <ivan> | 2009-03-14 23:44:38 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-03-14 23:44:38 +0000 |
commit | dae7ad7ff2a06ae047de9fd6d88e74edc526b4ad (patch) | |
tree | 981f4e9d19d3fb9a1059a3de0a48479980835db0 | |
parent | 64916ad920572e19351df79127d4822fab57f621 (diff) |
fix emailed logos to come from db config, not old files, RT#3093 / RT#4963
-rw-r--r-- | FS/FS/cust_bill.pm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 1f78d72f4..c8384c009 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -660,21 +660,22 @@ sub generate_email { my $from = $1 || 'example.com'; my $content_id = join('.', rand()*(2**32), $$, time). "\@$from"; - my $path = "$FS::UID::conf_dir/conf.$FS::UID::datasrc"; - my $file; + my $logo; + my $agentnum = $self->cust_main->agentnum; if ( defined($args{'template'}) && length($args{'template'}) - && -e "$path/logo_". $args{'template'}. ".png" + && $conf->exists( 'logo_'. $args{'template'}. '.png', $agentnum ) ) { - $file = "$path/logo_". $args{'template'}. ".png"; + $logo = 'logo_'. $args{'template'}. '.png'; } else { - $file = "$path/logo.png"; + $logo = "logo.png"; } + my $image_data = $conf->config_binary( $logo, $agentnum); my $image = build MIME::Entity 'Type' => 'image/png', 'Encoding' => 'base64', - 'Path' => $file, + 'Data' => $image_data, 'Filename' => 'logo.png', 'Content-ID' => "<$content_id>", ; |