예제 #1
0
파일: Sender.php 프로젝트: t4web/mail
 public function send($to, $templateName, array $data = [])
 {
     $template = $this->templateBuilder->get($templateName);
     $message = $this->mailAssembler->assemble($to, $template, $data);
     $this->mailTransport->send($message);
     $event = new Event('mail-send:post', $this, ['to' => $to, 'template' => $template, 'message' => $message, 'data' => $data]);
     $this->eventManager->trigger($event);
 }
예제 #2
0
 public function testGetWithBadConfig()
 {
     $renderer = $this->prophesize(RendererInterface::class);
     $config = ['from-email' => '*****@*****.**', 'from-name' => 'Support Mail.com', 'templates' => [], 'layout' => ['default' => 't4web-mail/layout/default']];
     $factory = new TemplateBuilder($config, $renderer->reveal());
     $this->setExpectedException(TemplateNotExistsException::class);
     $templateName = 'xxx';
     $factory->get($templateName);
 }