View | Details | Raw Unified | Return to bug 14723
Collapse All | Expand All

(-)a/C4/Letters.pm (-5 / +10 lines)
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
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt (-8 / +7 lines)
Lines 91-103 Link Here
91
        </td>
91
        </td>
92
        <td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates  with_hours => 1 %]</td>
92
        <td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates  with_hours => 1 %]</td>
93
        <td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates  with_hours => 1 %]</td>
93
        <td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates  with_hours => 1 %]</td>
94
	    <td>
94
        <td>
95
        [% IF ( QUEUED_MESSAGE.delivery_note ) %]
95
        [% IF ( QUEUED_MESSAGE.error_code ) %]
96
            [% IF ( QUEUED_MESSAGE.delivery_note == "Invalid borrowernumber $borrowernumber" ) %]Invalid borrowernumber [% borrowernumber | html %]
96
            [% IF ( QUEUED_MESSAGE.error_code == "INVALID_BORNUMBER" ) %]Invalid borrowernumber [% borrowernumber | html %]
97
            [% ELSIF ( QUEUED_MESSAGE.delivery_note == 'Unable to find an email address for this borrower' ) %]Unable to find an email address for this borrower
97
            [% ELSIF ( QUEUED_MESSAGE.error_code == 'NO_EMAIL' ) %]Unable to find an email address for this borrower
98
            [% ELSIF ( QUEUED_MESSAGE.delivery_note == 'Missing SMS number' ) %]Missing SMS number
98
            [% ELSIF ( QUEUED_MESSAGE.error_code == 'MISSING_SMS' ) %]Missing SMS number
99
            [% ELSIF ( QUEUED_MESSAGE.delivery_note == 'Message is duplicate' ) %]Message is duplicate
99
            [% ELSIF ( QUEUED_MESSAGE.error_code == 'DUPLICATE_MESSAGE' ) %]Message is duplicate
100
            [% ELSIF ( QUEUED_MESSAGE.delivery_note == 'No notes from SMS driver' ) %]No notes from SMS driver
100
            [% ELSIF ( QUEUED_MESSAGE.error_code == 'NO_NOTES' ) %]No notes from SMS driver
101
            [% ELSE %]Error occured while sending email.
101
            [% ELSE %]Error occured while sending email.
102
            [% END %]
102
            [% END %]
103
        [% END %]
103
        [% END %]
104
- 

Return to bug 14723