public function validateAndImportContact()
    {
        define('MAUTIC_SOURCE_INGESTION', 1);

        $this->valid  = false;
        $this->status = Stat::TYPE_ERROR;

        try {
            $this->handleInputPrivate();
            $this->createContact();

            // @todo - Requirements - Evaluate required fields based on all the fields that are used in the campaign.
            // (This would best be done by cron, and cached somewhere as a list like campaign_required_fields)
            // (presuppose the overridden fields, if any)

            $this->evaluateLimits();

            // @todo - Duplicates - Evaluate Source duplicates against the cache. This is different than contact duplicates,
            // as we only care about duplicates within the source. It is unsustainable to check against all contacts
            // ever received by Mautic, so we only check for duplicates received by this source within a time frame.

            $this->saveContact();

            // @todo - Optionally allow a segment to be targeted instead of a campaign in the future? No problem...
            // /** @var \Mautic\LeadBundle\Model\ListModel $leadListModel */
            // $leadListModel = $this->container->get('mautic.lead.model.list');
            // $leadListModel->addLead($this->contact, [LeadList $list], true, !$this->realTime, -1);

            $this->addContactToCampaign();
            $this->processOffline();
            $this->processRealTime();
            $this->applyAttribution();
            $this->createCache();
            $this->processParallel();
        } catch (\Exception $exception) {
            $this->handleException($exception);
        }
        $this->logResults();

        return $this;
    }
public function validateAndImportContact()
    {
        define('MAUTIC_SOURCE_INGESTION', 1);

        $this->valid  = false;
        $this->status = Stat::TYPE_ERROR;

        try {
            $this->handleInputPrivate();
            $this->createContact();

            // @todo - Requirements - Evaluate required fields based on all the fields that are used in the campaign.
            // (This would best be done by cron, and cached somewhere as a list like campaign_required_fields)
            // (presuppose the overridden fields, if any)

            $this->evaluateLimits();

            // @todo - Duplicates - Evaluate Source duplicates against the cache. This is different than contact duplicates,
            // as we only care about duplicates within the source. It is unsustainable to check against all contacts
            // ever received by Mautic, so we only check for duplicates received by this source within a time frame.

            $this->saveContact();

            // @todo - Optionally allow a segment to be targeted instead of a campaign in the future? No problem...
            // /** @var \Mautic\LeadBundle\Model\ListModel $leadListModel */
            // $leadListModel = $this->container->get('mautic.lead.model.list');
            // $leadListModel->addLead($this->contact, [LeadList $list], true, !$this->realTime, -1);

            $this->addContactToCampaign();
            $this->processOffline();
            $this->processRealTime();
            $this->applyAttribution();
            $this->createCache();
            $this->processParallel();
        } catch (\Exception $exception) {
            $this->handleException($exception);
        }
        $this->logResults();

        return $this;
    }
public function validateAndImportContact ( ) { define ( 'MAUTIC_SOURCE_INGESTION' , 1 ) ; $ this -> valid = false ; $ this -> status = Stat :: TYPE_ERROR ; try { $ this -> handleInputPrivate ( ) ; $ this -> createContact ( ) ; // @todo - Requirements - Evaluate required fields based on all the fields that are used in the campaign. // (This would best be done by cron, and cached somewhere as a list like campaign_required_fields) // (presuppose the overridden fields, if any) $ this -> evaluateLimits ( ) ; // @todo - Duplicates - Evaluate Source duplicates against the cache. This is different than contact duplicates, // as we only care about duplicates within the source. It is unsustainable to check against all contacts // ever received by Mautic, so we only check for duplicates received by this source within a time frame. $ this -> saveContact ( ) ; // @todo - Optionally allow a segment to be targeted instead of a campaign in the future? No problem... // /** @var \Mautic\LeadBundle\Model\ListModel $leadListModel */ // $leadListModel = $this->container->get('mautic.lead.model.list'); // $leadListModel->addLead($this->contact, [LeadList $list], true, !$this->realTime, -1); $ this -> addContactToCampaign ( ) ; $ this -> processOffline ( ) ; $ this -> processRealTime ( ) ; $ this -> applyAttribution ( ) ; $ this -> createCache ( ) ; $ this -> processParallel ( ) ; } catch ( \ Exception $ exception ) { $ this -> handleException ( $ exception ) ; } $ this -> logResults ( ) ; return $ this ; }
Given the needed parameters, import the contact if applicable.

@return $this
Given the needed parameters import the contact if applicable .