Skip to content

Commit 95878b7

Browse files
committed
add encoding to TransportBuilder
1 parent db0dce6 commit 95878b7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ protected function prepareMessage()
377377
{
378378
$template = $this->getTemplate();
379379
$content = $template->processTemplate();
380+
380381
switch ($template->getType()) {
381382
case TemplateTypesInterface::TYPE_TEXT:
382383
$part['type'] = MimeInterface::TYPE_TEXT;
@@ -391,7 +392,10 @@ protected function prepareMessage()
391392
new Phrase('Unknown template type')
392393
);
393394
}
395+
396+
/** @var \Magento\Framework\Mail\MimePartInterface $mimePart */
394397
$mimePart = $this->mimePartInterfaceFactory->create(['content' => $content]);
398+
$this->messageData['encoding'] = $mimePart->getCharset();
395399
$this->messageData['body'] = $this->mimeMessageInterfaceFactory->create(
396400
['parts' => [$mimePart]]
397401
);
@@ -400,6 +404,7 @@ protected function prepareMessage()
400404
(string)$template->getSubject(),
401405
ENT_QUOTES
402406
);
407+
403408
$this->message = $this->emailMessageInterfaceFactory->create($this->messageData);
404409

405410
return $this;

0 commit comments

Comments
 (0)