From 5d085c0605b75f0f079a1e207524b923268b0d13 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 10 Sep 2021 11:38:25 +0200 Subject: [PATCH] Bug 28803: Replace INVALID_EMAIL with UNKNOWN_ERROR There can be other exceptions/errors raised by Koha::Email->create. On a follow-up bug report we should deal with the different possible errors to handle them properly --- C4/Letters.pm | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 07a47380b15..292945ab90c 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -1410,7 +1410,7 @@ sub _send_message_by_email { { message_id => $message->{'message_id'}, status => 'failed', - failure_code => 'INVALID_EMAIL' + failure_code => 'UNKNOWN_ERROR' } ); return 0; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt index 5503654b668..907de12d31d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt @@ -95,7 +95,7 @@ [% 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 ( QUEUED_MESSAGE.failure_code == "INVALID_EMAIL" ) %]Invalid email address found [% borrowernumber | html %] + [% ELSIF ( QUEUED_MESSAGE.failure_code == "UNKNOWN_ERROR" ) %]Unknown error (could be that an invalid email address was 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 -- 2.25.1