Browse Source

Bug 26948: Remove double encoding from sent emails

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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Joonas Kylmälä 12 months ago
committed by Jonathan Druart
parent
commit
4415fdb0f4
  1. 4
      C4/Letters.pm

4
C4/Letters.pm

@ -1315,11 +1315,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;

Loading…
Cancel
Save