/**
  * @param mixed $subject
  * @throws EntityValidationException
  * @throws NotFoundEntityException
  */
 public function send($subject)
 {
     if (!is_array($subject)) {
         return;
     }
     if (!isset($subject['Summit']) || !isset($subject['Speaker'])) {
         return;
     }
     $summit = $subject['Summit'];
     $speaker = $subject['Speaker'];
     if (!$speaker instanceof IPresentationSpeaker) {
         return;
     }
     if (!$summit instanceof ISummit) {
         return;
     }
     if ($speaker->breakoutEmailAlreadySent($summit->getIdentifier())) {
         throw new EntityValidationException('Speaker Email already Sent!');
     }
     $email = PermamailTemplate::get()->filter('Identifier', PRESENTATION_SPEAKER_SUMMIT_REMINDER_EMAIL)->first();
     if (is_null($email)) {
         throw new NotFoundEntityException(sprintf('Email Template %s does not exists on DB!', PRESENTATION_SPEAKER_SUMMIT_REMINDER_EMAIL));
     }
     $schedule_page = SummitAppSchedPage::get()->filter('SummitID', $summit->getIdentifier())->first();
     if (is_null($schedule_page)) {
         throw new NotFoundEntityException('Summit Schedule page does not exists!');
     }
     $speaker->registerBreakOutSent($summit->getIdentifier(), 'SECOND_BREAKOUT_REMAINDER');
     $email = EmailFactory::getInstance()->buildEmail(null, $speaker->getEmail());
     $email->setUserTemplate(PRESENTATION_SPEAKER_SUMMIT_REMINDER_EMAIL)->populateTemplate(array('Speaker' => $speaker, 'Summit' => $summit, 'ScheduleMainPageLink' => $schedule_page->getAbsoluteLiveLink(false)))->send();
 }
 /**
  * @param mixed $subject
  * @throws Exception
  */
 public function send($subject)
 {
     if (!is_array($subject)) {
         return;
     }
     if (!isset($subject['Summit']) || !isset($subject['Speaker']) || !isset($subject['PromoCode'])) {
         return;
     }
     $summit = $subject['Summit'];
     $speaker = $subject['Speaker'];
     $role = $subject['Role'];
     $promo_code = $subject['PromoCode'];
     if (!$speaker instanceof IPresentationSpeaker) {
         return;
     }
     if (!$summit instanceof ISummit) {
         return;
     }
     if (!$promo_code instanceof SpeakerSummitRegistrationPromoCode) {
         return;
     }
     $email = PermamailTemplate::get()->filter('Identifier', PRESENTATION_SPEAKER_ALTERNATE_ONLY_EMAIL)->first();
     if (is_null($email)) {
         throw new Exception(sprintf('Email Template %s does not exists on DB!', PRESENTATION_SPEAKER_ALTERNATE_ONLY_EMAIL));
     }
     $speaker->registerAnnouncementEmailTypeSent(IPresentationSpeaker::AnnouncementEmailAlternate, $summit->ID);
     $email = EmailFactory::getInstance()->buildEmail(PRESENTATION_SPEAKER_NOTIFICATION_ACCEPTANCE_EMAIL_FROM, $speaker->getEmail());
     $schedule_page = SummitAppSchedPage::getBy($summit);
     if (is_null($schedule_page)) {
         throw new Exception('Summit Schedule page does not exists!');
     }
     $email->setUserTemplate(PRESENTATION_SPEAKER_ALTERNATE_ONLY_EMAIL)->populateTemplate(array('Speaker' => $speaker, 'Role' => $role, 'ConfirmationLink' => $speaker->getSpeakerConfirmationLink($summit->ID), 'PromoCode' => $promo_code->getCode(), 'Summit' => $summit, 'ScheduleMainPageLink' => $schedule_page->getAbsoluteLiveLink(false)))->send();
 }
 /**
  * @param mixed $subject
  * @throws Exception
  */
 public function send($subject)
 {
     if (!is_array($subject)) {
         return;
     }
     if (!isset($subject['Summit']) || !isset($subject['Name']) || !isset($subject['Email']) || !isset($subject['PromoCode'])) {
         return;
     }
     $summit = $subject['Summit'];
     $name = $subject['Name'];
     $email_address = $subject['Email'];
     $promo_code = $subject['PromoCode'];
     if (!$summit instanceof ISummit) {
         return;
     }
     if (!$promo_code instanceof SummitRegistrationPromoCode) {
         return;
     }
     $email = PermamailTemplate::get()->filter('Identifier', MEMBER_PROMO_CODE_EMAIL)->first();
     if (is_null($email)) {
         throw new Exception(sprintf('Email Template %s does not exists on DB!', MEMBER_PROMO_CODE_EMAIL));
     }
     $email = EmailFactory::getInstance()->buildEmail(MEMBER_NOTIFICATION_PROMO_CODE_EMAIL_FROM, $email_address);
     $schedule_page = SummitAppSchedPage::get()->filter('SummitID', $summit->ID)->first();
     if (is_null($schedule_page)) {
         throw new Exception('Summit Schedule page does not exists!');
     }
     $email->setUserTemplate(MEMBER_PROMO_CODE_EMAIL)->populateTemplate(array('Name' => $name, 'PromoCode' => $promo_code->getCode(), 'Summit' => $summit, 'ScheduleMainPageLink' => $schedule_page->getAbsoluteLiveLink(false)))->send();
 }
 /**
  * @param mixed $subject
  * @throws NotFoundEntityException
  * @throws EntityValidationException
  */
 public function send($subject)
 {
     if (!is_array($subject)) {
         return;
     }
     if (!isset($subject['Summit']) || !isset($subject['Speaker'])) {
         return;
     }
     $summit = $subject['Summit'];
     $speaker = $subject['Speaker'];
     $promo_code = $subject['PromoCode'];
     if (!$speaker instanceof IPresentationSpeaker) {
         return;
     }
     if (!$summit instanceof ISummit) {
         return;
     }
     if (!$promo_code instanceof SpeakerSummitRegistrationPromoCode) {
         return;
     }
     if ($speaker->hasConfirmedAssistanceFor($summit->getIdentifier())) {
         throw new EntityValidationException('Speaker Already confirmed Assistance!');
     }
     if ($speaker->breakoutEmailAlreadySent($summit->getIdentifier())) {
         throw new EntityValidationException('Speaker Email already Sent!');
     }
     $email = PermamailTemplate::get()->filter('Identifier', PRESENTATION_SPEAKER_CONFIRM_SUMMIT_ASSISTANCE_EMAIL)->first();
     if (is_null($email)) {
         throw new NotFoundEntityException(sprintf('Email Template %s does not exists on DB!', PRESENTATION_SPEAKER_CONFIRM_SUMMIT_ASSISTANCE_EMAIL));
     }
     $schedule_page = SummitAppSchedPage::get()->filter('SummitID', $summit->getIdentifier())->first();
     if (is_null($schedule_page)) {
         throw new NotFoundEntityException('Summit Schedule page does not exists!');
     }
     $confirmation_link = $speaker->hasAssistanceFor($summit->getIdentifier()) ? $speaker->resetConfirmationLink($summit->getIdentifier()) : $speaker->getSpeakerConfirmationLink($summit->getIdentifier());
     $speaker->registerBreakOutSent($summit->getIdentifier(), 'SECOND_BREAKOUT_REGISTER');
     $email = EmailFactory::getInstance()->buildEmail(null, $speaker->getEmail());
     $email->setUserTemplate(PRESENTATION_SPEAKER_CONFIRM_SUMMIT_ASSISTANCE_EMAIL)->populateTemplate(array('Speaker' => $speaker, 'ConfirmationLink' => $confirmation_link, 'PromoCode' => $promo_code->getCode(), 'Summit' => $summit, 'ScheduleMainPageLink' => $schedule_page->getAbsoluteLiveLink(false)))->send();
 }
 /**
  * @param mixed $subject
  * @throws EntityValidationException
  * @throws NotFoundEntityException
  */
 public function send($subject)
 {
     if (!is_array($subject)) {
         return;
     }
     if (!isset($subject['Summit']) || !isset($subject['Speaker'])) {
         return;
     }
     $summit = $subject['Summit'];
     $speaker = $subject['Speaker'];
     if (!$speaker instanceof IPresentationSpeaker) {
         return;
     }
     if (!$summit instanceof ISummit) {
         return;
     }
     if (!$speaker->hasPendingRegistrationRequest()) {
         throw new EntityValidationException('speaker not has a pending registration request!');
     }
     $email = PermamailTemplate::get()->filter('Identifier', PRESENTATION_SPEAKER_CREATE_MEMBERSHIP_EMAIL)->first();
     if (is_null($email)) {
         throw new NotFoundEntityException(sprintf('Email Template %s does not exists on DB!', PRESENTATION_SPEAKER_CREATE_MEMBERSHIP_EMAIL));
     }
     $schedule_page = SummitAppSchedPage::get()->filter('SummitID', $summit->getIdentifier())->first();
     if (is_null($schedule_page)) {
         throw new NotFoundEntityException('Summit Schedule page does not exists!');
     }
     // reset token ...
     $registration_request = $speaker->RegistrationRequest();
     $token = $registration_request->generateConfirmationToken();
     $registration_request->write();
     $registration_url = Controller::join_links(Director::baseURL(), 'summit-login', 'registration');
     $registration_url = HTTP::setGetVar(SpeakerRegistrationRequest::ConfirmationTokenParamName, $token, $registration_url);
     $speaker->registerCreateMembershipSent();
     $email = EmailFactory::getInstance()->buildEmail(null, $speaker->getEmail());
     $email->setUserTemplate(PRESENTATION_SPEAKER_CREATE_MEMBERSHIP_EMAIL)->populateTemplate(array('Speaker' => $speaker, 'Summit' => $summit, 'RegistrationUrl' => $registration_url))->send();
 }
 /**
  * @param mixed $subject
  * @throws Exception
  */
 public function send($subject)
 {
     if (!is_array($subject)) {
         return;
     }
     if (!isset($subject['Event']) || !isset($subject['Attendee'])) {
         return;
     }
     $event = $subject['Event'];
     $attendee = $subject['Attendee'];
     if (!$attendee instanceof ISummitAttendee) {
         return;
     }
     $email = PermamailTemplate::get()->filter('Identifier', SUMMIT_ATTENDEE_RSVP_EMAIL)->first();
     if (is_null($email)) {
         throw new Exception(sprintf('Email Template %s does not exists on DB!', SUMMIT_ATTENDEE_RSVP_EMAIL));
     }
     $email = EmailFactory::getInstance()->buildEmail(SUMMIT_ATTENDEE_RSVP_EMAIL_FROM, $attendee->getMember()->getEmail());
     $schedule_page = SummitAppSchedPage::get()->filter('SummitID', $event->SummitID)->first();
     if (is_null($schedule_page)) {
         throw new NotFoundEntityException('Summit Schedule page does not exists!');
     }
     $email->setUserTemplate(SUMMIT_ATTENDEE_RSVP_EMAIL)->populateTemplate(array('Event' => $event, 'Attendee' => $attendee, 'ScheduleURL' => $schedule_page->getAbsoluteLiveLink(false)))->send();
 }
Exemple #7
0
 /**
  * @return string
  */
 public function getScheduleLink()
 {
     $page = SummitAppSchedPage::get()->filter('SummitID', $this->getIdentifier())->first();
     return $page ? $page->getAbsoluteLiveLink(false) : '#';
 }
 /**
  * @param string $type
  * @param bool $absolute
  * @return null|string
  */
 public function getLink($type = 'show', $absolute = true)
 {
     if ($type == 'show') {
         $page = SummitAppSchedPage::get()->filter('SummitID', $this->SummitID)->first();
         if ($page) {
             if ($absolute) {
                 return $page->getAbsoluteLiveLink(false) . 'events/' . $this->getIdentifier() . '/' . $this->getTitleForUrl();
             }
             return $page->RelativeLink(false) . 'events/' . $this->getIdentifier() . '/' . $this->getTitleForUrl();
         }
     }
     return null;
 }