예제 #1
0
 /**
  * action beIcsInvitation
  *
  * --> see ics template in Resources/Private/Backend/Templates/Email/
  *
  * @param Tx_WoehrlSeminare_Domain_Model_Event $event
  * @ignorevalidation $event
  * @return void
  */
 public function beIcsInvitationAction(Tx_WoehrlSeminare_Domain_Model_Event $event)
 {
     // startDateTime may never be empty
     $helper['start'] = $event->getStartDateTime()->getTimestamp();
     // endDateTime may be empty
     if ($event->getEndDateTime() instanceof DateTime && $event->getStartDateTime() != $event->getEndDateTime()) {
         $helper['end'] = $event->getEndDateTime()->getTimestamp();
     } else {
         $helper['end'] = $helper['start'];
     }
     if ($event->isAllDay()) {
         $helper['allDay'] = 1;
     }
     $helper['now'] = time();
     $helper['description'] = $this->foldline($this->html2rest($event->getDescription()));
     // location may be empty...
     if (is_object($event->getLocation())) {
         $helper['location'] = $event->getLocation()->getName();
         $helper['locationics'] = $this->foldline($event->getLocation()->getName());
     }
     $helper['nameto'] = strtolower(str_replace(array(',', ' '), array('', '-'), $event->getContact()->getName()));
     $this->sendTemplateEmail(array($event->getContact()->getEmail() => $event->getContact()->getName()), array($this->settings['senderEmailAddress'] => Tx_Extbase_Utility_Localization::translate('tx_woehrlseminare.be.eventmanagement', 'woehrl_seminare')), 'Termineinladung: ' . $event->getTitle(), 'Invitation', array('event' => $event, 'subscribers' => $event->getSubscribers(), 'attachSubscriberAsCsv' => TRUE, 'helper' => $helper, 'settings' => $this->settings, 'attachIcsInvitation' => TRUE));
     $this->view->assign('event', $event);
 }