diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php index 898d3ff400b38..b80f00b16f0bd 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php @@ -771,7 +771,7 @@ public function testConfirmationEmailWithSpecialCharacters(): void $this->assertContains('To: ' . $email, $rawMessage); - $content = $message->getBody()->getPartContent(0); + $content = $message->getBody()->getParts()[0]->getRawContent(); $confirmationUrl = $this->getConfirmationUrlFromMessageContent($content); $this->setRequestInfo($confirmationUrl, 'confirm'); $this->clearCookieMessagesList(); diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php index bcd4233655489..e971ca88c4e57 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php @@ -7,6 +7,9 @@ use Magento\TestFramework\Mail\Template\TransportBuilderMock; +/** + * \Magento\Newsletter\Model\Subscriber tests + */ class SubscriberTest extends \PHPUnit\Framework\TestCase { /** @@ -35,7 +38,7 @@ public function testEmailConfirmation() $this->assertContains( '/newsletter/subscriber/confirm/id/' . $this->model->getSubscriberId() . '/code/ysayquyajua23iq29gxwu2eax2qb6gvy', - $transportBuilder->getSentMessage()->getRawMessage() + $transportBuilder->getSentMessage()->getBody()->getParts()[0]->getRawContent() ); $this->assertEquals(Subscriber::STATUS_NOT_ACTIVE, $this->model->getSubscriberStatus()); } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php index f863edd049258..6dba48092c400 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php @@ -142,7 +142,7 @@ public function testSendEmailOnOrderSave(): void ); $this->assertEquals($message->getSubject(), $subject); - $this->assertThat($message->getRawMessage(), $assert); + $this->assertThat($message->getBody()->getParts()[0]->getRawContent(), $assert); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php index 2f23da8b3db87..13bcc756c2364 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php @@ -54,7 +54,7 @@ public function testSendEmailOnAddCreditmemoComment(): void ); $this->assertEquals($message->getSubject(), $subject); - $this->assertThat($message->getRawMessage(), $messageConstraint); + $this->assertThat($message->getBody()->getParts()[0]->getRawContent(), $messageConstraint); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php index f589a0f5a1c74..13d1fe89f149a 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php @@ -56,7 +56,7 @@ public function testSendEmailOnCreditmemoSave(): void ); $this->assertEquals($message->getSubject(), $subject); - $this->assertThat($message->getRawMessage(), $messageConstraint); + $this->assertThat($message->getBody()->getParts()[0]->getRawContent(), $messageConstraint); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/EmailTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/EmailTest.php index 4d19106ad8e51..2addc4d40ecda 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/EmailTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/EmailTest.php @@ -82,7 +82,7 @@ public function testSendOrderEmail(): void ); $this->assertEquals($message->getSubject(), $subject); - $this->assertThat($message->getRawMessage(), $assert); + $this->assertThat($message->getBody()->getParts()[0]->getRawContent(), $assert); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AddCommentTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AddCommentTest.php index 81e1dd7afc496..1db008690a154 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AddCommentTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AddCommentTest.php @@ -55,7 +55,7 @@ public function testSendEmailOnAddInvoiceComment(): void ); $this->assertEquals($message->getSubject(), $subject); - $this->assertThat($message->getRawMessage(), $messageConstraint); + $this->assertThat($message->getBody()->getParts()[0]->getRawContent(), $messageConstraint); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/EmailTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/EmailTest.php index 85223528ec82a..b2f4b8a6954d5 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/EmailTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/EmailTest.php @@ -59,7 +59,7 @@ public function testSendInvoiceEmail(): void ); $this->assertEquals($message->getSubject(), $subject); - $this->assertThat($message->getRawMessage(), $messageConstraint); + $this->assertThat($message->getBody()->getParts()[0]->getRawContent(), $messageConstraint); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php index 68074e38d9a39..40540f3126899 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php @@ -51,7 +51,7 @@ public function testSendEmailOnInvoiceSave(): void ); $this->assertEquals($message->getSubject(), $subject); - $this->assertThat($message->getRawMessage(), $messageConstraint); + $this->assertThat($message->getBody()->getParts()[0]->getRawContent(), $messageConstraint); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreateTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreateTest.php index 1035ce1592314..3fe3fca260e8b 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreateTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreateTest.php @@ -95,6 +95,6 @@ public function testSendEmailOnOrderPlace(): void ); $this->assertEquals($message->getSubject(), $subject); - $this->assertThat($message->getRawMessage(), $assert); + $this->assertThat($message->getBody()->getParts()[0]->getRawContent(), $assert); } } diff --git a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AddCommentTest.php b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AddCommentTest.php index 25a44bab62994..a2ac5883a13d9 100644 --- a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AddCommentTest.php +++ b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AddCommentTest.php @@ -54,7 +54,7 @@ public function testSendEmailOnShipmentCommentAdd(): void ); $this->assertEquals($message->getSubject(), $subject); - $this->assertThat($message->getRawMessage(), $messageConstraint); + $this->assertThat($message->getBody()->getParts()[0]->getRawContent(), $messageConstraint); } /** diff --git a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php index 27b5bb02d4b22..e95e99224a6d9 100644 --- a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php @@ -51,7 +51,7 @@ public function testSendEmailOnShipmentSave(): void ); $this->assertEquals($message->getSubject(), $subject); - $this->assertThat($message->getRawMessage(), $messageConstraint); + $this->assertThat($message->getBody()->getParts()[0]->getRawContent(), $messageConstraint); } /** diff --git a/lib/internal/Magento/Framework/Mail/Message.php b/lib/internal/Magento/Framework/Mail/Message.php index a9996c0a4f12a..b15b75ca9ac63 100644 --- a/lib/internal/Magento/Framework/Mail/Message.php +++ b/lib/internal/Magento/Framework/Mail/Message.php @@ -167,6 +167,8 @@ private function createMimeFromString($body, $messageType) { $part = new Part($body); $part->setCharset($this->zendMessage->getEncoding()); + $part->setEncoding(Mime::ENCODING_QUOTEDPRINTABLE); + $part->setDisposition(Mime::DISPOSITION_INLINE); $part->setType($messageType); $mimeMessage = new \Zend\Mime\Message(); $mimeMessage->addPart($part); diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php index bea2a9ea91d38..c29ca4d261cc4 100644 --- a/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php +++ b/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php @@ -26,9 +26,10 @@ public function testSetBodyHtml() $part = $this->message->getBody()->getParts()[0]; $this->assertEquals('text/html', $part->getType()); - $this->assertEquals('8bit', $part->getEncoding()); + $this->assertEquals('quoted-printable', $part->getEncoding()); $this->assertEquals('utf-8', $part->getCharset()); $this->assertEquals('body', $part->getContent()); + $this->assertEquals('inline', $part->getDisposition()); } public function testSetBodyText() @@ -37,8 +38,9 @@ public function testSetBodyText() $part = $this->message->getBody()->getParts()[0]; $this->assertEquals('text/plain', $part->getType()); - $this->assertEquals('8bit', $part->getEncoding()); + $this->assertEquals('quoted-printable', $part->getEncoding()); $this->assertEquals('utf-8', $part->getCharset()); $this->assertEquals('body', $part->getContent()); + $this->assertEquals('inline', $part->getDisposition()); } }