Ejemplo n.º 1
0
 /**
  * @param MailInterface $mail
  * @throws \RuntimeException
  */
 public function send(MailInterface $mail)
 {
     if (!$this->adapter->canSend($mail)) {
         throw new \RuntimeException('The e-mail could not be send with current configured mail-adapter.');
     }
     $this->adapter->send($mail);
 }
Ejemplo n.º 2
0
 /**
  * @param \Phpro\MailManager\Adapter\AdapterInterface $adapter
  * @param \Phpro\MailManager\Mail\MailInterface $mail
  */
 public function it_should_send_emails($adapter, $mail)
 {
     $adapter->canSend($mail)->willReturn(true);
     $adapter->send($mail)->shouldBeCalled();
     $this->send($mail);
 }