public function deleteQueuedMailsByRecipientId($userId) { $user = BOL_UserService::getInstance()->findUserById($userId); if ($user === null) { return; } $this->mailDao->deleteByRecipientEmail($user->email); }
public function processQueue($count = self::MAIL_COUNT_PER_CRON_JOB) { $list = $this->mailDao->findList($count); $processedIdList = array(); foreach ($list as $item) { try { $mail = $this->createMailFromDto($item); $this->send($mail); } catch (Exception $e) { //Skip invalid email adresses } $this->mailDao->updateSentStatus($item->id); } $this->mailDao->deleteSentMails(); }
/** * delete Pending by id * * @param * @return void */ public function deleteEmailById($id) { $pendingDao = $this->pendingDao; $pending = $pendingDao->findById($id); if ($pending) { $email = BOL_MailDao::getInstance()->findById($pending->emailId)->recipientEmail; BOL_MailDao::getInstance()->deleteById($pending->emailId); $pendingDao->delete($pending); // delete invatation $invitation = YNCONTACTIMPORTER_BOL_InvitationService::getInstance()->checkInvitedUser($email); if ($invitation) { YNCONTACTIMPORTER_BOL_InvitationService::getInstance()->delete($invitation); } } }