예제 #1
0
 /**
  *
  */
 public function execute()
 {
     $email = $this->emailService->create();
     $email->addTo('*****@*****.**');
     $this->emailService->setTemplate("/project/report-item/submit:mail");
     $this->emailService->send();
     print 'test';
 }
예제 #2
0
 /**
  * @param ServiceLocatorInterface $serviceLocator
  *
  * @return EmailService
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $config = $serviceLocator->get('Config');
     $emailService = new EmailService($config["email"]);
     /** @var AuthenticationService $authenticationService */
     $authenticationService = $serviceLocator->get('Application\\Authentication\\Service');
     $emailService->setAuthenticationService($authenticationService);
     /** @var GeneralService $generalService */
     $generalService = $serviceLocator->get(GeneralService::class);
     $emailService->setGeneralService($generalService);
     /** @var TwigRenderer $renderer */
     $renderer = $serviceLocator->get('ZfcTwigRenderer');
     $emailService->setRenderer($renderer);
     /** @var ContactService $contactService */
     $contactService = $serviceLocator->get(ContactService::class);
     $emailService->setContactService($contactService);
     return $emailService;
 }