From bc14a873fe6162433259600d975c4d544c8251cd Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 31 Oct 2024 16:11:59 +0000 Subject: [PATCH] Bug 30300: (QA follow-up) Move logic to queue_notice --- Koha/Patron.pm | 1 + misc/cronjobs/membership_expiry.pl | 14 +------------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index f97e104e216..9266a0fa5e2 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -2641,6 +2641,7 @@ sub queue_notice { } ); @message_transports = ( keys %{ $messaging_prefs->{transports} } ); $letter_code = $messaging_prefs->{transports}->{$message_transports[0]} unless $letter_code; + return if ($params->{message_name} eq 'Patron_Expiry' && !$messaging_prefs) } else { @message_transports = @{$params->{message_transports}}; } diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl index d2cd0a6595d..39544eafa83 100755 --- a/misc/cronjobs/membership_expiry.pl +++ b/misc/cronjobs/membership_expiry.pl @@ -262,25 +262,13 @@ while ( my $expiring_patron = $upcoming_mem_expires->next ) { next; } - my $messaging_prefs = C4::Members::Messaging::GetMessagingPreferences( - { - borrowernumber => $expiring_patron->borrowernumber, - message_name => "Patron_Expiry", - } - ); - my @message_transports = ( keys %{ $messaging_prefs->{transports} } ); - my $letter_code = $messaging_prefs->{letter_code}; - - # Skip this patron if they don't want a notification email for card expiry - next if !$messaging_prefs; - my $which_notice; if ($renew) { $expiring_patron->renew_account; $which_notice = $letter_renew; $count_renewed++; } else { - $which_notice = $letter_code || $letter_expiry; + $which_notice = $letter_expiry; } my $from_address = $expiring_patron->library->from_email_address; -- 2.39.3 (Apple Git-146)