Skip to content

Commit a5259e0

Browse files
author
Bohdan Berezhniy
committed
refactoring
1 parent 401f27c commit a5259e0

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Model/Magento/Framework/Mail/Template/TransportBuilder.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,17 @@ protected function prepareMessage()
480480

481481
$this->message = $this->emailMessageInterfaceFactory->create($this->messageData);
482482

483-
// Add Symfony Attachmets
483+
$this->addSymfonyAttachment($attachmentParts);
484+
485+
return $this;
486+
}
487+
488+
/**
489+
* @param array $attachmentParts
490+
* @return void
491+
*/
492+
private function addSymfonyAttachment(array $attachmentParts): void
493+
{
484494
if ($this->message instanceof \Magento\Framework\Mail\EmailMessage && method_exists($this->message, 'getSymfonyMessage')) {
485495
$symfonyEmail = $this->message->getSymfonyMessage();
486496

@@ -495,8 +505,6 @@ protected function prepareMessage()
495505
new \Symfony\Component\Mime\Part\Multipart\MixedPart($htmlPart, ...$attachmentParts)
496506
);
497507
}
498-
499-
return $this;
500508
}
501509

502510
/**
@@ -527,7 +535,7 @@ private function addAddressByType(string $addressType, $email, ?string $name = n
527535
}
528536

529537
/**
530-
* @return bool-
538+
* @return bool
531539
*/
532540
private function isMagentoVersionLte248(): bool
533541
{

0 commit comments

Comments
 (0)