For DUE message (and PREDUE, etc.) there are no check before sending the
message to the message_queue table.
This check avoids to try to send again and again the same message. Now
it is marked as "failed".
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Without the patch a sms notice will remain as 'pending' forever.
With the patch applied, the status is set to 'failed'.
Passes all tests and QA script.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
sub _send_message_by_sms {
my $message = shift or return;
my $member = C4::Members::GetMember( 'borrowernumber' => $message->{'borrowernumber'} );
- return unless $member->{'smsalertnumber'};
+
+ unless ( $member->{smsalertnumber} ) {
+ _set_message_status( { message_id => $message->{'message_id'},
+ status => 'failed' } );
+ return;
+ }
my $success = C4::SMS->send_sms( { destination => $member->{'smsalertnumber'},
message => $message->{'content'},