From 861a32282d2c6cff0454616713378febd52a9730 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Thu, 24 Jun 2021 14:25:55 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20=E2=80=94=20Bulk.pl=20didn't?= =?UTF-8?q?=20deliver=20mails=20if=20failed=20to=20personalize=20(#1174=20?= =?UTF-8?q?followup)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/Sympa/Message.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Sympa/Message.pm b/src/lib/Sympa/Message.pm index 3eb53066d..641a19663 100644 --- a/src/lib/Sympa/Message.pm +++ b/src/lib/Sympa/Message.pm @@ -1625,11 +1625,11 @@ sub personalize_text { ) ) { $log->syslog( - 'err', + 'info', 'Failed parsing template: %s', $template->{last_error} ); - return undef; + return $body; } return $message_output; From 12194be2dc065bcbcf0ac2a9de292932dd623a44 Mon Sep 17 00:00:00 2001 From: IKEDA Soji Date: Sat, 26 Jun 2021 06:06:04 +0900 Subject: [PATCH 2/2] Simplification --- src/lib/Sympa/Message.pm | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/lib/Sympa/Message.pm b/src/lib/Sympa/Message.pm index 641a19663..2a61d732a 100644 --- a/src/lib/Sympa/Message.pm +++ b/src/lib/Sympa/Message.pm @@ -1527,19 +1527,8 @@ sub _merge_msg { return $entity; } - ## PARSAGE ## - - my $message_output; - unless ( - defined( - $message_output = - personalize_text($utf8_body, $list, $rcpt, $data) - ) - ) { - $log->syslog('err', 'Error merging message'); - return undef; - } - $utf8_body = $message_output; + $utf8_body = personalize_text($utf8_body, $list, $rcpt, $data); + return $entity unless defined $utf8_body; ## Data not encodable by original charset will fallback to UTF-8. my ($newcharset, $newenc); @@ -1629,7 +1618,7 @@ sub personalize_text { 'Failed parsing template: %s', $template->{last_error} ); - return $body; + return undef; } return $message_output; @@ -1815,11 +1804,7 @@ sub _footer_text { } if ($mode) { $footer_text = - personalize_text($footer_text, $list, $rcpt, $data); - unless (defined $footer_text) { - $log->syslog('info', 'Error personalizing %s', $type); - $footer_text = ''; - } + personalize_text($footer_text, $list, $rcpt, $data) // ''; } $footer_text = '' unless $footer_text =~ /\S/; }