From c116540854c8aac002d18d833f59d00b79ddf963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Fri, 6 Nov 2020 13:35:39 +0200 Subject: [PATCH] Bug 22343: (QA follow-up) Remove double encoding from sent emails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sent emails from Koha were garbled / double encoded because Koha::Email now after the refactoring and moving to use Email::Stuffer handles the encoding itself. Previously the Koha::Email callee had to handle the encoding. This patch removes the double encoding in the email subject and content. To test: 1) Put some UTF-8 characters like ä in the HOLD template subject and body 2) Create hold and check-in an item to make it Waiting and cause the email to be send 3) Notice the email comes garbled / double encoded 4) Apply patch 5) Repeat step 2) and notice the email comes without any issues in encoding and look OK. 6) Make sure "prove t/Koha/Email.t" and "prove t/db_dependent/Letters.t" and passes Signed-off-by: Joonas Kylmälä --- C4/Letters.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index cd0c651f03..2470073eb8 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -1314,11 +1314,9 @@ sub _send_message_by_email { } } - # Encode subject line separately - $message->{subject} = encode('MIME-Header', $message->{'subject'} ); my $subject = $message->{'subject'}; - my $content = encode('UTF-8', $message->{'content'}); + my $content = $message->{'content'}; my $content_type = $message->{'content_type'} || 'text/plain; charset="UTF-8"'; my $is_html = $content_type =~ m/html/io; -- 2.11.0