-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters