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 ); }