Bugzilla – Attachment 132003 Details for
Bug 29501
gather_print_notices.pl does not use SMTP servers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29501: Make gather_print_notices.pl use Koha::Email
Bug-29501-Make-gatherprintnoticespl-use-KohaEmail.patch (text/plain), 2.35 KB, created by
Jonathan Druart
on 2022-03-22 10:40:44 UTC
(
hide
)
Description:
Bug 29501: Make gather_print_notices.pl use Koha::Email
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-03-22 10:40:44 UTC
Size:
2.35 KB
patch
obsolete
>From 7ac527cbc7a616bd4beab3a0ebfd9fc7a9a7e201 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 18 Nov 2021 09:40:22 -0300 >Subject: [PATCH] Bug 29501: Make gather_print_notices.pl use Koha::Email > >This patch makes the cronjob script use Koha::Email and thus relying on >configured SMTP settings instead of just trying localhost. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > misc/cronjobs/gather_print_notices.pl | 27 ++++++++++++++------------- > 1 file changed, 14 insertions(+), 13 deletions(-) > >diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl >index 488ce0791e7..692b53b2e0c 100755 >--- a/misc/cronjobs/gather_print_notices.pl >+++ b/misc/cronjobs/gather_print_notices.pl >@@ -13,8 +13,8 @@ use Getopt::Long qw( GetOptions ); > use C4::Log qw( cronlogaction ); > > use Koha::DateUtils qw( dt_from_string output_pref ); >+use Koha::Email; > use Koha::Util::OpenDocument qw( generate_ods ); >-use MIME::Lite; > > my ( > $help, >@@ -280,11 +280,12 @@ sub send_files { > my $from = $params->{from}; > return unless $to and $from; > >- my $mail = MIME::Lite->new( >- From => $from, >- To => $to, >- Subject => 'Print notices for ' . $today_syspref, >- Type => 'multipart/mixed', >+ my $email = Koha::Email->create( >+ { >+ from => $from, >+ to => $to, >+ subject => 'Print notices for ' . $today_syspref, >+ } > ); > > while ( my ( $type, $filenames ) = each %$files ) { >@@ -299,20 +300,20 @@ sub send_files { > > next unless $mimetype; > >- my $filepath = File::Spec->catdir( $directory, $filename ); >+ my $filepath = File::Spec->catfile( $directory, $filename ); > > next unless $filepath or -f $filepath; > >- $mail->attach( >- Type => $mimetype, >- Path => $filepath, >- Filename => $filename, >- Encoding => 'base64', >+ $email->attach_file( >+ $filepath, >+ content_type => $mimetype, >+ name => $filename, >+ disposition => 'attachment', > ); > } > } > >- $mail->send; >+ $email->send_or_die; > } > > =head1 NAME >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29501
:
127789
|
127790
|
127794
|
131446
|
131447
|
131448
|
131989
|
131990
|
131991
|
131992
| 132003 |
132004
|
132005
|
132006