Bug 40260

Summary: HOLDDGST doen't work for print
Product: Koha Reporter: Marion Durand <marion.durand>
Component: NoticesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Marion Durand 2025-06-27 09:40:26 UTC
Currently, when a patron chooses to receive digest only notification for hold filled but have no email address, Koha fall back on a print notification.
This notification is using the HOLD template, and the request to receive digest is ignored. Multiple notification will be generated if multiple holds are filled.

This seems due to the code around https://github.com/Koha-Community/Koha/blob/main/C4/Reserves.pm#L1929 in Koha/C4/Reserves.pm function _koha_notify_reserve

#Making sure that a print notification is sent if no other transport types can be utilized.
if ( !$notification_sent ) {
    &$send_notification( 'print', 'HOLD' );
}

To reproduce : 
1- Choose a borrower, make sure it has :
    - no email address
    - patron messaging prefereces : Hold filled : Email and Digests only
2-Create 2 holds for this borrower
3- Checkin document for these holds and confirm the hold each time
4- Go back to the patron page, on the Notices tab, 2 print notification are generated.