From c8a36a1b95eb26648474bbade26acdbdff77f56b Mon Sep 17 00:00:00 2001 From: Didier Gautheron Date: Fri, 24 Sep 2021 16:42:38 +0200 Subject: [PATCH] Bug 28803: (20.11.x) Add invalid email handling in _send_message_by_email Quickfix version for 20.11.x because of missing dependancies. Based on Bug 28996. Signed-off-by: Fridolin Somers --- C4/Letters.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 28b90fded0..671ff58e66 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -342,6 +342,7 @@ sub SendAlerts { ) or return; # FIXME: This 'default' behaviour should be moved to Koha::Email + my $success = try { my $mail = Koha::Email->create( { to => $email, @@ -359,7 +360,6 @@ sub SendAlerts { $mail->text_body( $letter->{content} ); } - my $success = try { $mail->send_or_die({ transport => $library->smtp_server->transport }); } catch { @@ -493,6 +493,7 @@ sub SendAlerts { # ... then send mail my $library = Koha::Libraries->find( $userenv->{branch} ); + my $success = try { my $mail = Koha::Email->create( { to => join( ',', @email ), @@ -519,7 +520,6 @@ sub SendAlerts { $mail->text_body( "" . $letter->{content} ); } - my $success = try { $mail->send_or_die({ transport => $library->smtp_server->transport }); } catch { @@ -1359,6 +1359,7 @@ sub _send_message_by_email { $branch_returnpath = $library->branchreturnpath; } + try { my $email = Koha::Email->create( { to => $to_address, @@ -1406,7 +1407,6 @@ sub _send_message_by_email { if !$message->{to_address} || $message->{to_address} ne $email->email->header('To'); - try { $email->send_or_die({ transport => $smtp_server->transport }); _set_message_status( -- 2.39.5