Ejemplo n.º 1
0
 /**
  * Trigger point actions for page hits
  *
  * @param Events\PageHitEvent $event
  */
 public function onPageHit(Events\PageHitEvent $event)
 {
     $hit = $event->getHit();
     $redirect = $hit->getRedirect();
     if ($redirect && ($email = $hit->getEmail())) {
         // Check for an email stat
         /** @var \Mautic\EmailBundle\Model\EmailModel $model */
         $model = $this->factory->getModel('email');
         $clickthrough = $event->getClickthroughData();
         if (isset($clickthrough['stat'])) {
             $stat = $model->getEmailStatus($clickthrough['stat']);
         }
         if (empty($stat)) {
             if ($lead = $hit->getLead()) {
                 // Try searching by email and lead IDs
                 $stats = $model->getEmailStati($hit->getSourceId(), $lead->getId());
                 if (count($stats)) {
                     $stat = $stats[0];
                 }
             }
         }
         if (!empty($stat)) {
             // Check to see if it has been marked as opened
             if (!$stat->isRead()) {
                 // Mark it as read
                 $model->hitEmail($stat, $this->request);
             }
         }
     }
 }
Ejemplo n.º 2
0
 public function onPageHit(PageHitEvent $event)
 {
     $types = array(PageEvents::PAGE_ON_HIT);
     $groups = array('hitDetails', 'emailDetails', 'pageList', 'leadList');
     $hit = $event->getHit();
     $payload = array('hit' => $hit);
     $webhooks = $this->getEventWebooksByType($types);
     $this->webhookModel->QueueWebhooks($webhooks, $payload, $groups, true);
 }
Ejemplo n.º 3
0
 /**
  * Trigger actions for page hits
  *
  * @param PageHitEvent $event
  */
 public function onPageHit(PageHitEvent $event)
 {
     /** @var \Mautic\CampaignBundle\Model\CampaignModel $model */
     $model = $this->factory->getModel('campaign');
     $hit = $event->getHit();
     $page = $hit->getPage();
     $typeId = $page instanceof Page ? 'page.pagehit.' . $page->getId() : null;
     $model->triggerEvent('page.pagehit', $hit, $typeId);
 }
Ejemplo n.º 4
0
 /**
  * Trigger point actions for page hits.
  *
  * @param Events\PageHitEvent $event
  */
 public function onPageHit(Events\PageHitEvent $event)
 {
     if ($event->getPage()) {
         // Mautic Landing Page was hit
         $this->pointModel->triggerAction('page.hit', $event->getHit());
     } else {
         // Mautic Tracking Pixel was hit
         $this->pointModel->triggerAction('url.hit', $event->getHit());
     }
 }
Ejemplo n.º 5
0
 /**
  * @param PageHitEvent $event
  */
 public function onPageHit(PageHitEvent $event)
 {
     $hit = $event->getHit();
     $source = $hit->getSource();
     if ($source == 'focus' || $source == 'focus.focus') {
         $sourceId = $hit->getSourceId();
         $focus = $this->model->getEntity($sourceId);
         if ($focus && $focus->isPublished()) {
             $this->model->addStat($focus, Stat::TYPE_CLICK, $hit);
         }
     }
 }
Ejemplo n.º 6
0
 /**
  * Trigger actions for page hits
  *
  * @param PageHitEvent $event
  */
 public function onPageHit(PageHitEvent $event)
 {
     $hit = $event->getHit();
     $channel = 'page';
     $channelId = null;
     if ($redirect = $hit->getRedirect()) {
         $channel = 'page.redirect';
         $channelId = $redirect->getId();
     } elseif ($page = $hit->getPage()) {
         $channelId = $page->getId();
     }
     $this->campaignEventModel->triggerEvent('page.pagehit', $hit, $channel, $channelId);
 }