예제 #1
0
 private function sendChangeEmails(Show $show, PreUpdateEventArgs $event)
 {
     $authorisationEmailSent = false;
     if ($event->hasChangedField('society') && $show->getSociety() instanceof Society) {
         if ($show->isAuthorised()) {
             $this->moderationManager->notifySocietyChanged($show);
         } else {
             $this->moderationManager->autoApproveOrEmailModerators($show);
             $authorisationEmailSent = true;
         }
     }
     if ($event->hasChangedField('venue') && $show->getVenue() instanceof Venue) {
         if ($show->isAuthorised()) {
             $this->moderationManager->notifyVenueChanged($show);
         } elseif (!$authorisationEmailSent) {
             $this->moderationManager->autoApproveOrEmailModerators($show);
         }
     }
 }
예제 #2
0
 public function sendShowSocietyChangedEmail(Show $show, array $owners, array $moderators)
 {
     $toEmails = $this->emailArrayFromUsers($moderators);
     $message = \Swift_Message::newInstance()->setSubject('Society changed to ' . $show->getSociety()->getName() . ': ' . $show->getName())->setFrom(array($this->from_address => 'camdram.net'))->setTo($toEmails)->setBody($this->twig->render('ActsCamdramBundle:Email:show_society_changed.txt.twig', array('owners' => $owners, 'show' => $show)));
     $this->mailer->send($message);
 }