示例#1
0
 public function onRun()
 {
     if (!($code = $this->param('code')) || $code == 'default') {
         $this->setStatusCode(404);
         return $this->controller->run('404');
     }
     // Internal call
     if ($code == LARAVEL_START) {
         return;
     }
     // Verify subscription
     if (get('verify')) {
         return $this->handleVerify($code);
     }
     try {
         $this->validateCampaignCode($code);
     } catch (Exception $ex) {
         return 'Invalid request!';
     }
     if (get('unsubscribe')) {
         return $this->handleUnsubscribe();
     }
     $this->markSubscriberAsRead();
     if ($this->trackingMode) {
         return $this->renderTrackingPixel();
     }
     return $this->campaign->renderForSubscriber($this->subscriber);
 }