From af92a8f990d6889403a1d72223dce32abea17ce4 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 17 Feb 2023 15:52:58 +0000 Subject: [PATCH] Bug 3150: (follow-up) Send list and cart emails immediately again With this patch set the cart and list emails are sent via the message_queue instead of bypassing it and being sent immediately. This patch keeps them in message_queue, but also sends them immediately, restoring the previous behavior. Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- basket/sendbasket.pl | 4 +++- opac/opac-sendbasket.pl | 4 +++- opac/opac-sendshelf.pl | 4 +++- virtualshelves/sendshelf.pl | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 24c5d99db2..0250e07a5d 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -101,7 +101,7 @@ if ( $email_add ) { content => Encode::encode("UTF-8", $iso2709), }; - C4::Letters::EnqueueLetter({ + my $message_id = C4::Letters::EnqueueLetter({ letter => $letter, message_transport_type => 'email', to_address => $email_add, @@ -109,6 +109,8 @@ if ( $email_add ) { attachments => [$attachment], }); + C4::Letters::SendQueuedMessages({ message_id => $message_id }); + $template->param( SENT => 1 ); } $template->param( email_add => $email_add ); diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index 3a28d55c5c..b7ac930d66 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -99,7 +99,7 @@ if ( $email_add ) { content => Encode::encode("UTF-8", $iso2709), }; - C4::Letters::EnqueueLetter({ + my $message_id = C4::Letters::EnqueueLetter({ letter => $letter, message_transport_type => 'email', to_address => $email_add, @@ -107,6 +107,8 @@ if ( $email_add ) { attachments => [$attachment], }); + C4::Letters::SendQueuedMessages({ message_id => $message_id }); + $template->param( SENT => 1 ); } diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index ddfc164910..758a32c8db 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -116,7 +116,7 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { content => Encode::encode("UTF-8", $iso2709), }; - C4::Letters::EnqueueLetter({ + my $message_id = C4::Letters::EnqueueLetter({ letter => $letter, message_transport_type => 'email', borrowernumber => $patron->borrowernumber, @@ -125,6 +125,8 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { attachments => [$attachment], }); + C4::Letters::SendQueuedMessages({ message_id => $message_id }); + $template->param( SENT => 1 ); } diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index 5079568e39..032c9fd8a5 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -115,7 +115,7 @@ if ($to_address) { content => Encode::encode("UTF-8", $iso2709), }; - C4::Letters::EnqueueLetter({ + my $message_id = C4::Letters::EnqueueLetter({ letter => $letter, message_transport_type => 'email', borrowernumber => $patron->borrowernumber, @@ -124,6 +124,8 @@ if ($to_address) { attachments => [$attachment], }); + C4::Letters::SendQueuedMessages({ message_id => $message_id }); + $template->param( SENT => 1 ); } -- 2.30.2