Ejemplo n.º 1
0
 private function sendApplicationMail(Application $application, string $mail_address)
 {
     $mailText = $application->getName() . " has applied to join Eternal Destiny.\n" . "Ingame-Tag: #" . $application->getTag() . "\n" . "E-Mail adress: " . $application->getEmail() . "\n" . "Age: " . $application->getAge() . "\n" . "Town-Hall Level: " . $application->getTh() . "\n" . "Current war stars: " . $application->getWarStars() . "\n" . "Current spoils of war status: " . $application->getSpoilsOfWar() . "\n" . "Current gold grab status: " . $application->getGoldGrab() . "\n" . "Current nice and tidy status: " . $application->getNiceAndTidy() . "\n" . "About me: " . $application->getInfos() . "\n" . "Why I want to join ED: " . $application->getWhy() . "\n" . "Strategies: " . $application->getStrategies() . "\n" . "Process application at: " . $_SERVER['SERVER_NAME'] . '/applynow/detail/' . $application->getId();
     $this->appMailService->sendMail($mail_address, 'New application has arrived!', $mailText, [getcwd() . '/public' . $application->getBasePic(), getcwd() . '/public' . $application->getProfilePic()]);
 }
Ejemplo n.º 2
0
 /**
  * @param Application $application to be saved
  *
  * @throws \Exception
  */
 public function saveApplication(Application $application)
 {
     $data = ['name' => $application->getName(), 'tag' => $application->getTag(), 'email' => $application->getEmail(), 'strategies' => $application->getStrategies(), 'th' => $application->getTh(), 'warStars' => $application->getWarStars(), 'age' => $application->getAge(), 'infos' => $application->getInfos(), 'why' => $application->getWhy(), 'niceAndTidy' => $application->getNiceAndTidy(), 'spoilsOfWar' => $application->getSpoilsOfWar(), 'goldGrab' => $application->getGoldGrab(), 'basepic' => $application->getBasepic(), 'profilepic' => $application->getProfilepic(), 'processed' => $application->getProcessed(), 'processed_by' => $application->getProcessedBy(), 'date_applied' => $application->getDateApplied(), 'mails_send' => $application->getMailsSend()];
     $id = (int) $application->getId();
     if ($id == 0) {
         $this->tableGateway->insert($data);
     } else {
         if ($this->getApplication($id)) {
             $this->tableGateway->update($data, ['id' => $id]);
         } else {
             throw new \Exception('Application id does not exist');
         }
     }
 }