Skip to content

Commit 1067166

Browse files
author
Roman Lytvynenko
committed
MC-33700: TransportBuilder unable to send emails of Content-Type "text/plain"
1 parent 380ca84 commit 1067166

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
use Magento\Framework\App\TemplateTypesInterface;
1313
use Magento\Framework\Exception\LocalizedException;
1414
use Magento\Framework\Exception\MailException;
15-
use Magento\Framework\Mail\EmailMessageInterface;
16-
use Magento\Framework\Mail\EmailMessageInterfaceFactory;
1715
use Magento\Framework\Mail\AddressConverter;
16+
use Magento\Framework\Mail\EmailMessageInterfaceFactory;
1817
use Magento\Framework\Mail\Exception\InvalidArgumentException;
1918
use Magento\Framework\Mail\MessageInterface;
2019
use Magento\Framework\Mail\MessageInterfaceFactory;
@@ -28,7 +27,7 @@
2827
use Magento\Framework\Phrase;
2928

3029
/**
31-
* TransportBuilder
30+
* TransportBuilder for Mail Templates
3231
*
3332
* @api
3433
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -380,11 +379,11 @@ protected function prepareMessage()
380379

381380
switch ($template->getType()) {
382381
case TemplateTypesInterface::TYPE_TEXT:
383-
$part['type'] = MimeInterface::TYPE_TEXT;
382+
$partType = MimeInterface::TYPE_TEXT;
384383
break;
385384

386385
case TemplateTypesInterface::TYPE_HTML:
387-
$part['type'] = MimeInterface::TYPE_HTML;
386+
$partType = MimeInterface::TYPE_HTML;
388387
break;
389388

390389
default:
@@ -395,10 +394,10 @@ protected function prepareMessage()
395394

396395
/** @var \Magento\Framework\Mail\MimePartInterface $mimePart */
397396
$mimePart = $this->mimePartInterfaceFactory->create(
398-
[
399-
'content' => $content,
400-
'type' => $part['type']
401-
]
397+
[
398+
'content' => $content,
399+
'type' => $partType
400+
]
402401
);
403402
$this->messageData['encoding'] = $mimePart->getCharset();
404403
$this->messageData['body'] = $this->mimeMessageInterfaceFactory->create(

0 commit comments

Comments
 (0)