From 483814601b190c41b27e5b2b51a85475f39c46c7 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 8 Nov 2021 08:10:38 -0300 Subject: [PATCH] Bug 29330: (QA follow-up) Use passed MIME type Signed-off-by: Tomas Cohen Arazi https://bugs.koha-community.org/show_bug.cgi?id=29303 --- C4/Letters.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 1274593807..60465e6f88 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -1247,10 +1247,10 @@ sub _add_attachments { $message->text_body( $letter->{content} ); } - foreach my $attachment ( @$attachments ) { + foreach my $attachment (@$attachments) { $message->attach( Encode::encode( "UTF-8", $attachment->{content} ), - content_type => 'application/octet-stream', + content_type => ( exists $attachment->{type} && $attachment->{type} ne '' ) ? $attachment->{type} : 'application/octet-stream', name => $attachment->{filename}, disposition => 'attachment', ); -- 2.33.1