From 53127abc0377bc3f04364c4183baacef3d4c95c4 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 12 Nov 2021 08:55:42 +0000 Subject: [PATCH] Bug 29330: (QA follow-up) Change to message/rfc822 This content-type might be more appropriated to use as a temporary label for the serialized email message with attachments. WARNING: perl -cw tells you that the constant is redefined. This has to do with an already existing module dependency loop of Letters. Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- C4/Letters.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 1ad8198fe4..30566cd4dd 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -45,6 +45,8 @@ use Koha::Subscriptions; use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); +use constant SERIALIZED_EMAIL_CONTENT_TYPE => 'message/rfc822'; + BEGIN { require Exporter; @ISA = qw(Exporter); @@ -1239,7 +1241,7 @@ sub ResendMessage { This routine picks the I of I and generates a MIME email, attaching the passed I using Koha::Email. The content is replaced by the string representation of the MIME object, - and the content-type is updated to B for later handling. + and the content-type is updated for later handling. =cut @@ -1268,7 +1270,7 @@ sub _add_attachments { ); } - $letter->{'content-type'} = 'MIME'; + $letter->{'content-type'} = SERIALIZED_EMAIL_CONTENT_TYPE; $letter->{content} = $message->as_string; return $letter; @@ -1420,7 +1422,7 @@ sub _send_message_by_email { subject => "" . $message->{subject} }; - if ( $message->{'content_type'} && $message->{'content_type'} eq 'MIME' ) { + if ( $message->{'content_type'} && $message->{'content_type'} eq SERIALIZED_EMAIL_CONTENT_TYPE ) { # The message has been previously composed as a valid MIME object # and serialized as a string on the DB -- 2.39.5