Bug 21738: check items count in C4:ILSDI::HoldTitle
[koha.git] / C4 / Suggestions.pm
index e3a7ffd..e2dd3e7 100644 (file)
@@ -503,14 +503,8 @@ sub ModSuggestion {
         # fetch the entire updated suggestion so that we can populate the letter
         my $full_suggestion = GetSuggestion( $suggestion->{suggestionid} );
         my $patron = Koha::Patrons->find( $full_suggestion->{suggestedby} );
-        my $transport;
 
-        #Set message_transport_type of suggestion notice to email by default, unless the patron has a smsalertnumber set and no email address set
-        if ($patron->smsalertnumber && (!$patron->email)) {
-            $transport="sms";
-        } else {
-            $transport="email";
-        }
+        my $transport = (C4::Context->preference("FallbackToSMSIfNoEmail")) && ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email';
 
         if (
             my $letter = C4::Letters::GetPreparedLetter(