From 59abdcdeb584746898ca26110eb5cec23d1d8277 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 20 Feb 2023 07:10:17 +0000 Subject: [PATCH] Bug 32316: Send list share invites and accepts immediately For emails triggered manually it's save and helpful to send them immediately. This patch takes care of SHARE_INVITE and SHARE_ACCEPT. To test: * Enable OpacAllowSharingPrivateLists * Configure SMTP servers * Set KohaAdminEmailAddress and an email address in your user * Create a private list in the OPAC * Share the list with your email * Verify that you receive the email immediately (in the message_queue the status will be sent) * Create a second user to log into the OPAC with * Log out of the OPAC * Click on the link in the invite email or copy/paste it to the browser * Log in as your second user so the list is shared --- opac/opac-shareshelf.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl index 29edd82293..6fb57da660 100755 --- a/opac/opac-shareshelf.pl +++ b/opac/opac-shareshelf.pl @@ -177,7 +177,7 @@ sub notify_owner { ); #send letter to queue - C4::Letters::EnqueueLetter( + my $message_id = C4::Letters::EnqueueLetter( { letter => $letter, message_transport_type => 'email', @@ -185,6 +185,7 @@ sub notify_owner { to_address => $toaddr, } ); + C4::Letters::SendQueuedMessages({ message_id => $message_id }); } sub process_addrlist { @@ -246,7 +247,7 @@ sub send_invitekey { ); #send letter to queue - C4::Letters::EnqueueLetter( + my $message_id = C4::Letters::EnqueueLetter( { letter => $letter, message_transport_type => 'email', @@ -254,6 +255,7 @@ sub send_invitekey { to_address => $a, } ); + C4::Letters::SendQueuedMessages({ message_id => $message_id }) } $param->{appr_addr} = \@ok; } -- 2.30.2