Skip to content

Commit

Permalink
restore sales email builder
Browse files Browse the repository at this point in the history
  • Loading branch information
karliuka committed Dec 22, 2018
1 parent 415dde3 commit 689169e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions Model/Framework/Mail/Template/TransportBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* Mail Template Transport Builder
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Faonni\Smtp\Model\Framework\Mail\Template;

use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\Mail\Template\TransportBuilder as OriginTransportBuilder;
use Magento\Framework\Mail\Template\FactoryInterface;
use Magento\Framework\Mail\MessageInterface;
use Magento\Framework\Mail\Template\SenderResolverInterface;
use Magento\Framework\Mail\TransportInterfaceFactory;
use Magento\Framework\Mail\MessageInterfaceFactory;

/**
* Transport builder
*/
class TransportBuilder extends OriginTransportBuilder
{
/**
* Initialize transport builder
*
* @param FactoryInterface $templateFactory
* @param MessageInterface $message
* @param SenderResolverInterface $senderResolver
* @param ObjectManagerInterface $objectManager
* @param TransportInterfaceFactory $mailTransportFactory
* @param MessageInterfaceFactory $messageFactory
*/
public function __construct(
FactoryInterface $templateFactory,
MessageInterface $message,
SenderResolverInterface $senderResolver,
ObjectManagerInterface $objectManager,
TransportInterfaceFactory $mailTransportFactory,
MessageInterfaceFactory $messageFactory = null
) {
$this->templateFactory = $templateFactory;
$this->objectManager = $objectManager;
$this->_senderResolver = $senderResolver;
$this->mailTransportFactory = $mailTransportFactory;
$this->messageFactory = $messageFactory ?: $this->objectManager->get(MessageInterfaceFactory::class);
$this->message = $message;
}
}
1 change: 1 addition & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
<argument name="resourceModel" xsi:type="string">Faonni\Smtp\Model\ResourceModel\Log</argument>
</arguments>
</type>
<preference for="Magento\Framework\Mail\Template\TransportBuilder" type="Faonni\Smtp\Model\Framework\Mail\Template\TransportBuilder" />
</config>

0 comments on commit 689169e

Please sign in to comment.