Bug 36487 - Add an option to add new conditions for processing failure_code on members/notices.pl
Summary: Add an option to add new conditions for processing failure_code on members/no...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-02 07:39 UTC by Anni Rajala
Modified: 2024-04-02 07:39 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anni Rajala 2024-04-02 07:39:40 UTC
At the moment on borrowers notices.pl page there is a column "Delivery note" that displays the reason the delivery has failed. The reason is displayed based on the following conditions:

[% IF ( QUEUED_MESSAGE.failure_code ) %]
[% IF ( QUEUED_MESSAGE.failure_code == "INVALID_BORNUMBER" ) %]Invalid borrowernumber [% borrowernumber | html %]
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_EMAIL' ) %]Unable to find an email address for this borrower
[% ELSIF (matches = QUEUED_MESSAGE.failure_code.match('INVALID_EMAIL:(\w+)') ) %]Invalid [% matches.0 | html %] email address found [% borrowernumber | html %]
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_FROM' ) %]Missing from email address
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'MISSING_SMS' ) %]Missing SMS number
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'DUPLICATE_MESSAGE' ) %]Message is duplicate
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'NO_NOTES' ) %]No notes from SMS driver
[% ELSIF ( QUEUED_MESSAGE.failure_code == 'SENDMAIL' ) %]Unhandled email failure, check the logs for further details
[% ELSIF ( QUEUED_MESSAGE.failure_code == "UNKNOWN_ERROR" ) %]Unknown error
[% ELSE %]Error occurred while sending email.
[% END %]
[% END %]

Sms providers might send back failure_codes outside that list. In those cases "Delivery note" -colum displays the text "Error occurred while sending email" which doesn't give the proper info for the librarian. If it would be possible to add your own ELSIF conditions, we could provide accurate information for the librarians dealing with the failed messages.