From b1dbd8ceadd906b6e32bd7be7ca190ad251a27cf Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Wed, 11 Feb 2026 11:04:36 +0200 Subject: [PATCH] Bug 41813: Use library's From-address for ILL staff notifications When sending ILL staff notifications, the email "To" and "From" addresses are set equal. Libraries' sending address may differ from receiving address, so this feature should be using the usual From-address that Koha uses in any other types of email notifications. This patch changes ILL staff notifications to use the usual From address. Before applying this patch, to reproduce: 1. Create the following SQL report SELECT * FROM message_queue ORDER BY message_id DESC; 2. Enable ILL requests using system preference ILLModule 3. Navigate to Administration > Libraries 4. Make sure "ILL staff email" is empty 5. Make sure "Email" is empty 6. Set system preference ILLDefaultStaffEmail to test@example.org 7. Set system preference KohaAdminEmailAddress to library@example.org 8. Set system preference ILLSendStaffNotices to ILL_REQUEST_CANCEL|ILL_REQUEST_MODIFIED|ILL_PICKUP_READY|ILL_PARTNER_REQ|ILL_REQUEST_UNAVAIL|ILL_REQUEST_UPDATE|ILL_REQ_CREATED 9. Navigate to OPAC 10. Create a new ILL request from OPAC 11. Run your SQL report from step 1 12. Observe first row column from_address as test@example.org It should be library@example.org instead Apply this patch To test: 1. Unless you already didn't, create the following SQL report SELECT * FROM message_queue ORDER BY message_id DESC; 2. Enable ILL requests using system preference ILLModule 3. Navigate to Administration > Libraries 4. Make sure "ILL staff email" is empty 5. Make sure "Email" is empty 6. Set system preference ILLDefaultStaffEmail to test@example.org 7. Set system preference KohaAdminEmailAddress to library@example.org 8. Set system preference ILLSendStaffNotices to ILL_REQUEST_CANCEL|ILL_REQUEST_MODIFIED|ILL_PICKUP_READY|ILL_PARTNER_REQ|ILL_REQUEST_UNAVAIL|ILL_REQUEST_UPDATE|ILL_REQ_CREATED 9. Navigate to OPAC 10. Create a new ILL request from OPAC 11. Run your SQL report from step 1 12. Observe first row column from_address as library@example.org --- Koha/ILL/Request.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index 50a8f733bcc..117f833e20f 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -1981,7 +1981,7 @@ sub send_staff_notice { # Try and get an address to which to send staff notices my $branch = Koha::Libraries->find( $self->branchcode ); my $to_address = $branch->inbound_ill_address; - my $from_address = $branch->inbound_ill_address; + my $from_address = $branch->from_email_address; my $params = { letter => $letter, -- 2.34.1