Skip to content

Commit

Permalink
[TASK] removed unnecessary mail class, switch to mailTransportFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
dheesbeen committed Dec 10, 2018
1 parent 1e61003 commit 7ecbfaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 86 deletions.
81 changes: 0 additions & 81 deletions Mail/Transport.php

This file was deleted.

11 changes: 6 additions & 5 deletions Model/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ class Mail

protected $emailCatcherFactory;

protected $transport;
protected $mailTransportFactory;

public function __construct(
\Magento\Framework\Mail\Message $messageFactory,
\Experius\EmailCatcher\Model\EmailcatcherFactory $emailcatcherFactory,
\Experius\EmailCatcher\Mail\Transport $transport
\Magento\Framework\Mail\TransportInterfaceFactory $transportInterfaceFactory
) {
$this->messageFactory = $messageFactory;
$this->emailCatcherFactory = $emailcatcherFactory;
$this->transport = $transport;
$this->mailTransportFactory = $transportInterfaceFactory;
}

public function sendMessage($emailCatcherId, $alternativeToAddress)
Expand All @@ -38,7 +38,8 @@ public function sendMessage($emailCatcherId, $alternativeToAddress)
$message->setBodyHtml($emailCatcher->getBody());
$message->setSubject(mb_encode_mimeheader($emailCatcher->getSubject()));

$this->transport->setMessage($message);
$this->transport->sendMessage();
$mailTransport = $this->mailTransportFactory->create(['message' => clone $message]);

$mailTransport->sendMessage();
}
}

0 comments on commit 7ecbfaf

Please sign in to comment.