/** * Load the Title * * @param ObjectManager $manager */ public function load(ObjectManager $manager) { $webInfo = new WebInfo(); $webInfo->setInfo("/project/invite:mail_new"); $webInfo->setSubject('New project invite'); $webInfo->setContent('[deeplink]'); $manager->persist($webInfo); $manager->flush(); $webInfo = new WebInfo(); $webInfo->setInfo("/project/invite:mail_existing"); $webInfo->setSubject('Existing project invite'); $webInfo->setContent('[deeplink]'); $manager->persist($webInfo); $manager->flush(); $webInfo = new WebInfo(); $webInfo->setInfo("/project/invite/accepted"); $webInfo->setSubject('Accepted project invite'); $webInfo->setContent('[deeplink]'); $manager->persist($webInfo); $manager->flush(); $webInfo = new WebInfo(); $webInfo->setInfo("/project/invite/confirmed"); $webInfo->setSubject('confirmed project invite'); $webInfo->setContent('[deeplink]'); $manager->persist($webInfo); $manager->flush(); }
/** * @param $templateName * * @return EmailService * * @throws \Exception */ public function setTemplate($templateName) { $this->template = $this->generalService->findWebInfoByInfo($templateName); if (is_null($this->template)) { throw new \InvalidArgumentException(sprintf('There is no no template with info "%s"', $templateName)); } if (is_null($this->email)) { throw new \RuntimeException("The email object is empty. Did you call create() first?"); } $this->email->setMessage($this->createTwigTemplate($this->template->getContent())); $this->email->setSubject($this->template->getSubject()); return $this; }