Esempio n. 1
0
 private function saveMailboxEntry(MailBoxEntry $mb)
 {
     $toObject = $this->userService->getUser($this->getMixId($mb->getRecipient()), false);
     $fromObject = $this->userService->getUser($this->getMixId($mb->getSender()), false);
     $mb->setOwner($toObject);
     $mb->setRecipient($toObject);
     $mb->setSender($fromObject);
     $this->mailboxDao->save($mb);
 }
 public function notifyNewMessage(MailBoxEntry $e)
 {
     $u = $e->getRecipient();
     $subjKey = "systemModule.notification.newMessage.subject";
     $bodyKey = "systemModule.notification.newMessage.body";
     $subject = $this->translator->translate($subjKey, null, ["host" => $this->getHostName()]);
     $body = $this->translator->translate($bodyKey, null, ["name" => $u->getName(), "surname" => $u->getSurname()]);
     $mail = new Message();
     $mail->setFrom($this->getSenderEmail())->setSubject($subject)->setBody($body)->addTo($u->getContact()->getEmail());
     $this->send($mail);
 }