/** * Dispatch actions to take according to current bounce level */ public function dispatch() { $this->findEmail(); // If couldn't find the original email we cannot do anything if (!$this->email) { Tools::log("Bounced email found but cannot find corresponding record in database. Skipped.", 1); return; } if ($this->bounceLevel != self::NEWSLETTER_NOT_A_BOUNCE) { if ($this->recipientList) { $this->recipientList->registerBounce($this->email->getRecipientAddress(), $this->bounceLevel); } $this->email->setBounceTime(new DateTime()); $emailRepository = $this->objectManager->get('Ecodev\\Newsletter\\Domain\\Repository\\EmailRepository'); $emailRepository->updateNow($this->email); } Tools::log("Bounced email found with bounce level " . $this->bounceLevel); }