From 665fce9dbb1ef6fe643f7692d28377833aab0cc4 Mon Sep 17 00:00:00 2001 From: Rostislav Wolny Date: Tue, 11 Sep 2018 18:40:46 +0200 Subject: [PATCH] Temporarily set every sending error to hard This is temporary solution until we implement follow-up feature https://mailpoet.atlassian.net/browse/MAILPOET-1155 [MAILPOET-1154] --- lib/Cron/Workers/SendingQueue/SendingQueue.php | 2 ++ lib/Mailer/MailerError.php | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lib/Cron/Workers/SendingQueue/SendingQueue.php b/lib/Cron/Workers/SendingQueue/SendingQueue.php index 2cbc8ef55b..a44275ad5d 100644 --- a/lib/Cron/Workers/SendingQueue/SendingQueue.php +++ b/lib/Cron/Workers/SendingQueue/SendingQueue.php @@ -206,6 +206,8 @@ class SendingQueue { if($send_result['response'] === false) { $error = $send_result['error']; assert($error instanceof MailerError); + // Always switch error level to hard until we implement UI for individual subscriber errors + $error->switchLevelToHard(); $this->error_handler->processError($error, $sending_task, $prepared_subscribers_ids, $prepared_subscribers); } // update processed/to process list diff --git a/lib/Mailer/MailerError.php b/lib/Mailer/MailerError.php index 46ad67504b..e9e666d1dc 100644 --- a/lib/Mailer/MailerError.php +++ b/lib/Mailer/MailerError.php @@ -73,6 +73,13 @@ class MailerError { return $this->subscribers_errors; } + /** + * Temporary method until we implement UI for subscriber errors + */ + function switchLevelToHard() { + $this->level = self::LEVEL_HARD; + } + function getMessageWithFailedSubscribers() { $message = $this->message ?: ''; if(!$this->subscribers_errors) {