Lines 1335-1341
sub _send_message_by_email {
Link Here
|
1335 |
warn "FAIL: No 'to_address' and INVALID borrowernumber ($message->{borrowernumber})"; |
1335 |
warn "FAIL: No 'to_address' and INVALID borrowernumber ($message->{borrowernumber})"; |
1336 |
_set_message_status( { message_id => $message->{'message_id'}, |
1336 |
_set_message_status( { message_id => $message->{'message_id'}, |
1337 |
status => 'failed', |
1337 |
status => 'failed', |
1338 |
delivery_note => 'Invalid borrowernumber '.$message->{borrowernumber} } ); |
1338 |
delivery_note => 'Invalid borrowernumber '.$message->{borrowernumber}, |
|
|
1339 |
error_code => 'INVALID_BORNUMBER' } ); |
1339 |
return; |
1340 |
return; |
1340 |
} |
1341 |
} |
1341 |
$to_address = $patron->notice_email_address; |
1342 |
$to_address = $patron->notice_email_address; |
Lines 1344-1350
sub _send_message_by_email {
Link Here
|
1344 |
# warning too verbose for this more common case? |
1345 |
# warning too verbose for this more common case? |
1345 |
_set_message_status( { message_id => $message->{'message_id'}, |
1346 |
_set_message_status( { message_id => $message->{'message_id'}, |
1346 |
status => 'failed', |
1347 |
status => 'failed', |
1347 |
delivery_note => 'Unable to find an email address for this borrower' } ); |
1348 |
delivery_note => 'Unable to find an email address for this borrower', |
|
|
1349 |
error_code => 'NO_EMAIL' } ); |
1348 |
return; |
1350 |
return; |
1349 |
} |
1351 |
} |
1350 |
} |
1352 |
} |
Lines 1483-1496
sub _send_message_by_sms {
Link Here
|
1483 |
unless ( $patron and $patron->smsalertnumber ) { |
1485 |
unless ( $patron and $patron->smsalertnumber ) { |
1484 |
_set_message_status( { message_id => $message->{'message_id'}, |
1486 |
_set_message_status( { message_id => $message->{'message_id'}, |
1485 |
status => 'failed', |
1487 |
status => 'failed', |
1486 |
delivery_note => 'Missing SMS number' } ); |
1488 |
delivery_note => 'Missing SMS number', |
|
|
1489 |
error_code => 'MISSING_SMS' } ); |
1487 |
return; |
1490 |
return; |
1488 |
} |
1491 |
} |
1489 |
|
1492 |
|
1490 |
if ( _is_duplicate( $message ) ) { |
1493 |
if ( _is_duplicate( $message ) ) { |
1491 |
_set_message_status( { message_id => $message->{'message_id'}, |
1494 |
_set_message_status( { message_id => $message->{'message_id'}, |
1492 |
status => 'failed', |
1495 |
status => 'failed', |
1493 |
delivery_note => 'Message is duplicate' } ); |
1496 |
delivery_note => 'Message is duplicate', |
|
|
1497 |
error_code => 'DUPLICATE_MESSAGE' } ); |
1494 |
return; |
1498 |
return; |
1495 |
} |
1499 |
} |
1496 |
|
1500 |
|
Lines 1499-1505
sub _send_message_by_sms {
Link Here
|
1499 |
} ); |
1503 |
} ); |
1500 |
_set_message_status( { message_id => $message->{'message_id'}, |
1504 |
_set_message_status( { message_id => $message->{'message_id'}, |
1501 |
status => ($success ? 'sent' : 'failed'), |
1505 |
status => ($success ? 'sent' : 'failed'), |
1502 |
delivery_note => ($success ? '' : 'No notes from SMS driver') } ); |
1506 |
delivery_note => ($success ? '' : 'No notes from SMS driver'), |
|
|
1507 |
error_code => 'NO_NOTES' } ); |
1503 |
|
1508 |
|
1504 |
return $success; |
1509 |
return $success; |
1505 |
} |
1510 |
} |