From 10ea5ec55b73226c6cbc21bae3050024b3534e1c Mon Sep 17 00:00:00 2001 From: Oluwaseun Olorunsola Date: Tue, 24 Jan 2023 16:57:18 +0100 Subject: [PATCH] Remove extra sending method check for new users. mta.method is probably not set yet. MAILPOET-4929 --- mailpoet/lib/Config/Activator.php | 8 ++------ mailpoet/lib/Util/Notices/DisabledMailFunctionNotice.php | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mailpoet/lib/Config/Activator.php b/mailpoet/lib/Config/Activator.php index 5cd80b05a6..90dca963e6 100644 --- a/mailpoet/lib/Config/Activator.php +++ b/mailpoet/lib/Config/Activator.php @@ -136,12 +136,8 @@ class Activator { if (!is_null($version)) return; // not a new user - $sendingMethodSet = $this->settings->get('mta.method', false); - - if ($sendingMethodSet === 'PHPMail') { - // check for valid mail function - $this->settings->set(DisabledMailFunctionNotice::QUEUE_DISABLED_MAIL_FUNCTION_CHECK, true); - } + // check for valid mail function on new installs + $this->settings->set(DisabledMailFunctionNotice::QUEUE_DISABLED_MAIL_FUNCTION_CHECK, true); } private function deleteAllMailPoetTablesAndData(): void { diff --git a/mailpoet/lib/Util/Notices/DisabledMailFunctionNotice.php b/mailpoet/lib/Util/Notices/DisabledMailFunctionNotice.php index cc4c000dcf..97f257ef7b 100644 --- a/mailpoet/lib/Util/Notices/DisabledMailFunctionNotice.php +++ b/mailpoet/lib/Util/Notices/DisabledMailFunctionNotice.php @@ -57,7 +57,7 @@ class DisabledMailFunctionNotice { $this->settings->set(self::QUEUE_DISABLED_MAIL_FUNCTION_CHECK, false); } - $sendingMethod = $this->settings->get('mta.method', false); + $sendingMethod = $this->settings->get('mta.method', SettingsController::DEFAULT_SENDING_METHOD); $isPhpMailSendingMethod = $sendingMethod === Mailer::METHOD_PHPMAIL; if (!$isPhpMailSendingMethod) {