Skip to content

Instantly share code, notes, and snippets.

@lfglopes
Created January 22, 2020 15:15
Show Gist options
  • Save lfglopes/a4d4eed2e8c0432fd8e60f0540a401fb to your computer and use it in GitHub Desktop.
Save lfglopes/a4d4eed2e8c0432fd8e60f0540a401fb to your computer and use it in GitHub Desktop.
--- vendor/magepal/magento2-gmailsmtpapp/Model/TwoDotThree/Smtp.php
+++ vendor/magepal/magento2-gmailsmtpapp/Model/TwoDotThree/Smtp.php
@@ -78,7 +78,9 @@
$dataHelper = $this->dataHelper;
$dataHelper->setStoreId($this->storeModel->getStoreId());
+ $encoding = $message->getEncoding();
$message = Message::fromString($message->getRawMessage());
+ $message->setEncoding($encoding);
//Set reply-to path
switch ($dataHelper->getConfigSetReturnPath()) {
--- vendor/magento/framework/Mail/Template/TransportBuilder.php
+++ vendor/magento/framework/Mail/Template/TransportBuilder.php
@@ -377,6 +377,7 @@ protected function prepareMessage()
{
$template = $this->getTemplate();
$content = $template->processTemplate();
+
switch ($template->getType()) {
case TemplateTypesInterface::TYPE_TEXT:
$part['type'] = MimeInterface::TYPE_TEXT;
@@ -391,7 +392,10 @@ protected function prepareMessage()
new Phrase('Unknown template type')
);
}
+
+ /** @var \Magento\Framework\Mail\MimePartInterface $mimePart */
$mimePart = $this->mimePartInterfaceFactory->create(['content' => $content]);
+ $this->messageData['encoding'] = $mimePart->getCharset();
$this->messageData['body'] = $this->mimeMessageInterfaceFactory->create(
['parts' => [$mimePart]]
);
@@ -400,6 +404,7 @@ protected function prepareMessage()
(string)$template->getSubject(),
ENT_QUOTES
);
+
$this->message = $this->emailMessageInterfaceFactory->create($this->messageData);
return $this;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment