Lines 1-5
Link Here
|
1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
2 |
|
2 |
|
|
|
3 |
use Koha::Patrons; |
4 |
|
3 |
return { |
5 |
return { |
4 |
bug_number => "30300", |
6 |
bug_number => "30300", |
5 |
description => "Add Patron expiry to messaging preference", |
7 |
description => "Add Patron expiry to messaging preference", |
Lines 44-49
return {
Link Here
|
44 |
|
46 |
|
45 |
); |
47 |
); |
46 |
say $out "MEMBERSHIP_EXPIRY added to message_transports"; |
48 |
say $out "MEMBERSHIP_EXPIRY added to message_transports"; |
|
|
49 |
|
50 |
my $days_notice = C4::Context->preference('MembershipExpiryDaysNotice'); |
51 |
if($days_notice) { |
52 |
my $patrons = Koha::Patrons->search(); |
53 |
while ( my $patron = $patrons->next ) { |
54 |
C4::Members::Messaging::SetMessagingPreference( |
55 |
{ |
56 |
borrowernumber => $patron->borrowernumber, |
57 |
message_attribute_id => $message_attribute_id, |
58 |
message_transport_types => ['email'], |
59 |
} |
60 |
); |
61 |
} |
62 |
} |
47 |
} else { |
63 |
} else { |
48 |
say $out "Patron_Expiry message attribute exists, skipping update"; |
64 |
say $out "Patron_Expiry message attribute exists, skipping update"; |
49 |
} |
65 |
} |