From b3125c9f3838edc357ecd2840e16d23d57ea1f59 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 1 Mar 2022 16:47:52 +0000 Subject: [PATCH] Bug 17648: (QA follow-up) Restore imediate sending of the notice The original notice was sent using SendAlerts, which triggers immediately on submission and doesn't wait for the cron task. This patch restores that immediacy and also fixes a bug in the imports on the original patch. Signed-off-by: Katrin Fischer Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall --- members/memberentry.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index 3958b6210e..96dc87f021 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -30,7 +30,7 @@ use C4::Context; use C4::Output qw( output_and_exit output_and_exit_if_error output_html_with_http_headers ); use C4::Members qw( checkcardnumber get_cardnumber_length ); use C4::Koha qw( GetAuthorisedValues ); -use C4::Letters qw( SendAlerts ); +use C4::Letters qw( GetPreparedLetter EnqueueLetter SendQueuedMessages ); use C4::Form::MessagingPreferences; use Koha::AuthUtils; use Koha::AuthorisedValues; @@ -478,7 +478,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ want_librarian => 1, ) or return; - my $success = EnqueueLetter( + my $message_id = EnqueueLetter( { letter => $letter, borrowernumber => $patron->id, @@ -486,6 +486,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ message_transport_type => 'email' } ); + SendQueuedMessages({ message_id => $message_id }); }; if ($@) { $template->param( error_alert => $@ ); -- 2.39.5