From a4b38a18b33c6551629af5261980bbaf0a4059b6 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 7 Nov 2018 11:35:36 +0000 Subject: [PATCH] Bug 21241: (follow-up) Code Golf Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- C4/Suggestions.pm | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index aa962732a7..b418f06348 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -503,17 +503,12 @@ 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; - #If FallbackToSMSIfNoEmail syspref is enabled and the patron has a smsalertnumber but no email address then set message_transport_type of suggestion notice to sms + + my $transport = 'email'; if (C4::Context->preference("FallbackToSMSIfNoEmail")) { - if (($patron->smsalertnumber) && (!$patron->email)) { - $transport="sms"; - } else { - $transport="email"; - } - } else { - $transport = "email"; + $transport = ($patron->smsalertnumber) && (!$patron->email) ? 'sms' : 'email'; } + if ( my $letter = C4::Letters::GetPreparedLetter( module => 'suggestions', -- 2.39.5