コード例 #1
0
 /**
  * Checks if additional notifications to the organizers are necessary.
  * In that case, the notification e-mails will be sent to all organizers.
  *
  * Additional notifications mails will be sent out upon the following events:
  * - an event now has enough registrations
  * - an event is fully booked
  * If both things happen at the same time (minimum and maximum count of
  * attendees are the same), only the "event is full" message will be sent.
  *
  * @param tx_seminars_registration $registration the registration for which the notification should be send
  *
  * @return void
  */
 public function sendAdditionalNotification(tx_seminars_registration $registration)
 {
     if ($registration->isOnRegistrationQueue()) {
         return;
     }
     $emailReason = $this->getReasonForNotification($registration);
     if ($emailReason == '') {
         return;
     }
     $event = $registration->getSeminarObject();
     /** @var $eMail tx_oelib_Mail */
     $eMail = t3lib_div::makeInstance('tx_oelib_Mail');
     $eMail->setSender($event->getFirstOrganizer());
     $eMail->setMessage($this->getMessageForNotification($registration, $emailReason));
     $eMail->setSubject(sprintf($this->translate('email_additionalNotification' . $emailReason . 'Subject'), $event->getUid(), $event->getTitleAndDate('-')));
     /** @var tx_seminars_OldModel_Organizer $organizer */
     foreach ($event->getOrganizerBag() as $organizer) {
         $eMail->addRecipient($organizer);
     }
     /** @var Tx_Oelib_MailerFactory $mailerFactory */
     $mailerFactory = t3lib_div::makeInstance('Tx_Oelib_MailerFactory');
     $mailerFactory->getMailer()->send($eMail);
 }