Browse Source

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>
21.11/bug30761
Marcel de Rooy 2 years ago
committed by Jonathan Druart
parent
commit
562e543c3e
  1. 8
      C4/Letters.pm

8
C4/Letters.pm

@ -40,6 +40,8 @@ use Koha::Patrons;
use Koha::SMTP::Servers;
use Koha::Subscriptions;
use constant SERIALIZED_EMAIL_CONTENT_TYPE => 'message/rfc822';
our (@ISA, @EXPORT_OK);
BEGIN {
require Exporter;
@ -1230,7 +1232,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
@ -1259,7 +1261,7 @@ sub _add_attachments {
);
}
$letter->{'content-type'} = 'MIME';
$letter->{'content-type'} = SERIALIZED_EMAIL_CONTENT_TYPE;
$letter->{content} = $message->as_string;
return $letter;
@ -1409,7 +1411,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

Loading…
Cancel
Save