From 57e110ee2c563b1b233234a4ccfc4aaa89a80b27 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 19 May 2026 16:40:34 +0100 Subject: [PATCH] Bug 42645: Use notice_email_address in ModSuggestion SMS fallback check The FallbackToSMSIfNoEmail transport selection in ModSuggestion() was checking $patron->email (the raw borrowers.email column) rather than $patron->notice_email_address, which respects the EmailFieldPrimary and EmailFieldPrecedence system preferences. Patrons with only emailpro or B_email set were incorrectly receiving suggestion status-change notices via SMS even when a valid email address was available. Sponsored-by: OpenFifth Signed-off-by: David Nind Signed-off-by: Lisette Scheer Signed-off-by: Pedro Amorim --- C4/Suggestions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 86be271def..527cf8e001 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -106,7 +106,7 @@ sub ModSuggestion { my $transport = ( C4::Context->preference("FallbackToSMSIfNoEmail") ) && ( $patron->smsalertnumber ) - && ( !$patron->email ) ? 'sms' : 'email'; + && ( !$patron->notice_email_address ) ? 'sms' : 'email'; if ( my $letter = C4::Letters::GetPreparedLetter(