Ejemplo n.º 1
0
 public function testData()
 {
     $data = ['smtp' => [], 'from' => 'from', 'to' => 'to', 'subject' => 'subject'];
     $this->options = new MailOptions($data);
     $this->assertInstanceOf(SmtpOptions::class, $this->options->getSmtp());
     $this->assertEquals($data['from'], $this->options->getFrom());
     $this->assertEquals($data['to'], $this->options->getTo());
     $this->assertEquals($data['subject'], $this->options->getSubject());
 }
Ejemplo n.º 2
0
 /**
  * @param array $messageData
  * @return \Swift_Mime_MimePart
  */
 private function createMessage(array $messageData) : \Swift_Mime_MimePart
 {
     return \Swift_Message::newInstance($this->options->getSubject())->setTo($this->options->getTo())->setFrom($this->options->getFrom())->setReplyTo($messageData['email'])->setBody($this->composeBody($messageData), 'text/html');
 }