public function testTextTemplate()
 {
     $textTemplate = $this->message->getTextViewModel();
     $this->assertInstanceOf('Zend\\View\\Model\\ModelInterface', $textTemplate);
     $firstName = $textTemplate->getVariable('firstName');
     $subject = $textTemplate->getVariable('subject');
     $template = $textTemplate->getTemplate();
     $this->assertEquals(static::FIRSTNAME, $firstName);
     $this->assertEquals(static::SUBJECT, $subject);
     $this->assertEquals(static::TEXTTEMPLATE, $template);
 }
Ejemplo n.º 2
0
 public function testSend()
 {
     $email = getenv('TEST_MAILGUNZF2_EMAIL');
     if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
         return;
     }
     $this->renderer->render($this->message);
     $this->message->addToRecipient($email);
     $this->message->setFromAddress($email);
     $this->sender->send($this->message);
 }
Ejemplo n.º 3
0
 public function send(MessageViewModel $message)
 {
     $domain = $this->options->getDomain();
     return $this->mg->post("{$domain}/messages", $message->getMessage(), $message->getFiles());
 }