From 1d9237f6b636c24b6eab7235d01ac6f9bb876a26 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: Lucas Gass --- C4/Suggestions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 368ce7c693..1ef06ec53e 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -108,7 +108,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(