Model/Sales/Quote.php
public function isIntervalCampaignFound($email, $storeId)
    {
        $cartLimit = $this->scopeConfig->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_ABANDONED_CART_LIMIT,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );

        //no limit is set skip
        if (! $cartLimit) {
            return false;
        }

        $fromTime = $this->timeZone->scopeDate($storeId, 'now', true);
        $toTime = clone $fromTime;
        $interval = $this->dateIntervalFactory->create(
            ['interval_spec' => sprintf('PT%sH', $cartLimit)]
        );
        $fromTime->sub($interval);

        $fromDate   = $fromTime->getTimestamp();
        $toDate     = $toTime->getTimestamp();
        $updated = [
            'from' => $fromDate,
            'to' => $toDate,
            'date' => true,
        ];

        //total campaigns sent for this interval of time
        $campaignLimit = $this->campaignCollection->create()
            ->getNumberOfCampaignsForContactByInterval($email, $updated);

        //found campaign
        if ($campaignLimit) {
            return true;
        }

        return false;
    }
public function isIntervalCampaignFound($email, $storeId)
    {
        $cartLimit = $this->scopeConfig->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_ABANDONED_CART_LIMIT,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );

        //no limit is set skip
        if (! $cartLimit) {
            return false;
        }

        $fromTime = $this->timeZone->scopeDate($storeId, 'now', true);
        $toTime = clone $fromTime;
        $interval = $this->dateIntervalFactory->create(
            ['interval_spec' => sprintf('PT%sH', $cartLimit)]
        );
        $fromTime->sub($interval);

        $fromDate   = $fromTime->getTimestamp();
        $toDate     = $toTime->getTimestamp();
        $updated = [
            'from' => $fromDate,
            'to' => $toDate,
            'date' => true,
        ];

        //total campaigns sent for this interval of time
        $campaignLimit = $this->campaignCollection->create()
            ->getNumberOfCampaignsForContactByInterval($email, $updated);

        //found campaign
        if ($campaignLimit) {
            return true;
        }

        return false;
    }
public function isIntervalCampaignFound ( $ email , $ storeId ) { $ cartLimit = $ this -> scopeConfig -> getValue ( \ Dotdigitalgroup \ Email \ Helper \ Config :: XML_PATH_CONNECTOR_ABANDONED_CART_LIMIT , \ Magento \ Store \ Model \ ScopeInterface :: SCOPE_STORE , $ storeId ) ; //no limit is set skip if ( ! $ cartLimit ) { return false ; } $ fromTime = $ this -> timeZone -> scopeDate ( $ storeId , 'now' , true ) ; $ toTime = clone $ fromTime ; $ interval = $ this -> dateIntervalFactory -> create ( [ 'interval_spec' => sprintf ( 'PT%sH' , $ cartLimit ) ] ) ; $ fromTime -> sub ( $ interval ) ; $ fromDate = $ fromTime -> getTimestamp ( ) ; $ toDate = $ toTime -> getTimestamp ( ) ; $ updated = [ 'from' => $ fromDate , 'to' => $ toDate , 'date' => true , ] ; //total campaigns sent for this interval of time $ campaignLimit = $ this -> campaignCollection -> create ( ) -> getNumberOfCampaignsForContactByInterval ( $ email , $ updated ) ; //found campaign if ( $ campaignLimit ) { return true ; } return false ; }
Send email only if the interval limit passed, no emails during this interval.
Return false for any found for this period.

@param string $email
@param int $storeId

@return bool
Send email only if the interval limit passed no emails during this interval . Return false for any found for this period .