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 <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 53127abc03)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
Marcel de Rooy 2021-11-12 08:55:42 +00:00 committed by Victor Grousset/tuxayo
parent 42015a0450
commit 97819f50f2
1 changed files with 5 additions and 3 deletions

View File

@ -44,6 +44,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);
@ -1224,7 +1226,7 @@ sub ResendMessage {
This routine picks the I<content> of I<letter> and generates a MIME
email, attaching the passed I<attachments> using Koha::Email. The
content is replaced by the string representation of the MIME object,
and the content-type is updated to B<MIME> for later handling.
and the content-type is updated for later handling.
=cut
@ -1253,7 +1255,7 @@ sub _add_attachments {
);
}
$letter->{'content-type'} = 'MIME';
$letter->{'content-type'} = SERIALIZED_EMAIL_CONTENT_TYPE;
$letter->{content} = $message->as_string;
return $letter;
@ -1377,7 +1379,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