/** * */ public function execute() { $email = $this->emailService->create(); $email->addTo('*****@*****.**'); $this->emailService->setTemplate("/project/report-item/submit:mail"); $this->emailService->send(); print 'test'; }
/** * @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; }