View | Details | Raw Unified | Return to bug 9530
Collapse All | Expand All

(-)a/misc/cronjobs/runreport.pl (-12 / +15 lines)
Lines 23-28 use warnings; Link Here
23
23
24
use C4::Reports::Guided; # 0.12
24
use C4::Reports::Guided; # 0.12
25
use C4::Context;
25
use C4::Context;
26
use Koha::Email;
26
27
27
use Getopt::Long qw(:config auto_help auto_version);
28
use Getopt::Long qw(:config auto_help auto_version);
28
use Pod::Usage;
29
use Pod::Usage;
Lines 266-287 foreach my $report_id (@ARGV) { Link Here
266
        }
267
        }
267
    }
268
    }
268
    if ($email){
269
    if ($email){
270
        my $message = Koha::Email->new();
269
        my %mail;
271
        my %mail;
270
        if ($format eq 'html') {
272
        if ($format eq 'html') {
271
                $message = "<html><head><style>tr:nth-child(2n+1) { background-color: #ccc;}</style></head><body>$message</body></html>";
273
                $message = "<html><head><style>tr:nth-child(2n+1) { background-color: #ccc;}</style></head><body>$message</body></html>";
272
           %mail = (
274
           %mail = $message->create_message_headers({
273
              To      => $to,
275
              to      => $to,
274
              From    => $from,
276
              from    => $from,
275
              'Content-Type' => 'text/html',
277
              contenttype => 'text/html',
276
              Subject => encode('utf8', $subject ),
278
              subject => encode('utf8', $subject ),
277
              Message => encode('utf8', $message )
279
              messsage => encode('utf8', $message )
280
           }
278
          );
281
          );
279
        } else {
282
        } else {
280
          %mail = (
283
          %mail = $message->create_message_headers ({
281
              To      => $to,
284
              to      => $to,
282
              From    => $from,
285
              from    => $from,
283
              Subject => encode('utf8', $subject ),
286
              subject => encode('utf8', $subject ),
284
              Message => encode('utf8', $message )
287
              message => encode('utf8', $message )
288
          }
285
          );
289
          );
286
        }
290
        }
287
        $mail{'Auth'} = {user => $username, pass => $password, method => $method} if $username;
291
        $mail{'Auth'} = {user => $username, pass => $password, method => $method} if $username;
288
- 

Return to bug 9530