Beispiel #1
0
 /**
  * Handle point triggers for new leads (including 0 point triggers)
  *
  * @param LeadEvent $event
  */
 public function onLeadSave(LeadEvent $event)
 {
     if ($event->isNew()) {
         /** @var \Mautic\PointBundle\Model\TriggerModel */
         $model = $this->factory->getModel('point.trigger');
         $model->triggerEvents($event->getLead());
     }
 }
 public function onLeadDelete(LeadEvent $event)
 {
     /** @var \Mautic\LeadBundle\Entity\Lead $lead */
     $lead = $event->getLead();
     $serializerGroups = array("leadDetails", "userList", "publishDetails", "ipAddress");
     $payload = array('lead' => $lead);
     $types = array(LeadEvents::LEAD_POST_DELETE);
     $webhooks = $this->getEventWebooksByType($types);
     $this->webhookModel->QueueWebhooks($webhooks, $payload, $serializerGroups, true);
 }
 /**
  * Add a lead delete entry to the audit log
  *
  * @param Events\LeadEvent $event
  */
 public function onLeadDelete(Events\LeadEvent $event)
 {
     $lead = $event->getLead();
     $log = array("bundle" => "lead", "object" => "lead", "objectId" => $lead->deletedId, "action" => "delete", "details" => array('name' => $lead->getPrimaryIdentifier()), "ipAddress" => $this->factory->getIpAddressFromRequest());
     $this->factory->getModel('core.auditLog')->writeToLog($log);
 }
Beispiel #4
0
 /**
  * Handle point triggers for new leads (including 0 point triggers).
  *
  * @param LeadEvent $event
  */
 public function onLeadSave(LeadEvent $event)
 {
     if ($event->isNew()) {
         $this->triggerModel->triggerEvents($event->getLead());
     }
 }
Beispiel #5
0
 /**
  * Add a lead delete entry to the audit log.
  *
  * @param Events\LeadEvent $event
  */
 public function onLeadDelete(Events\LeadEvent $event)
 {
     $lead = $event->getLead();
     $log = ['bundle' => 'lead', 'object' => 'lead', 'objectId' => $lead->deletedId, 'action' => 'delete', 'details' => ['name' => $lead->getPrimaryIdentifier()], 'ipAddress' => $this->ipLookupHelper->getIpAddressFromRequest()];
     $this->auditLogModel->writeToLog($log);
 }