Exemplo n.º 1
0
 public function testTransportUsesPostageService()
 {
     $service = $this->getMock('SlmMail\\Service\\PostageService', array(), array('my-secret-key'));
     $transport = new HttpTransport($service);
     $message = new Message();
     $service->expects($this->once())->method('send')->with($this->equalTo($message));
     $transport->send($message);
 }
Exemplo n.º 2
0
 public function testTransportUsesSesService()
 {
     $client = $this->getMock('Aws\\Ses\\SesClient', array(), array(), '', false);
     $service = $this->getMock('SlmMail\\Service\\SesService', array(), array($client));
     $transport = new HttpTransport($service);
     $message = new Message();
     $service->expects($this->once())->method('send')->with($this->equalTo($message));
     $transport->send($message);
 }
Exemplo n.º 3
0
 /**
  * Send a mail using this transport
  *
  * @return void
  * @throws \Magento\Framework\Exception\MailException
  */
 public function sendMessage()
 {
     try {
         $this->transport->send($this->message);
     } catch (\Exception $e) {
         $phrase = new \Magento\Framework\Phrase($e->getMessage());
         throw new \Magento\Framework\Exception\MailException($phrase, $e);
     }
     return true;
 }
Exemplo n.º 4
0
 /**
  * Send a mail using this transport
  *
  * @return void
  * @throws \Magento\Framework\Exception\MailException
  */
 public function sendMessage()
 {
     try {
         // \Zend_Debug::dump($this->message);
         // \Zend_Debug::dump($this->message->getHeaders());
         // die;
         $this->transport->send($this->message);
         // \Zend_Debug::dump(__LINE__);
         // die;
     } catch (\Exception $e) {
         $phrase = new \Magento\Framework\Phrase($e->getMessage());
         throw new \Magento\Framework\Exception\MailException($phrase, $e);
     }
     return true;
 }