コード例 #1
0
ファイル: ShowListener.php プロジェクト: dstansby/camdram
 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
ファイル: EmailDispatcher.php プロジェクト: dstansby/camdram
 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);
 }