Only queue test mail for sending when the mailpoet sending method is updated
MAILPOET-4760
This commit is contained in:
committed by
Aschepikov
parent
651e2d3c56
commit
9b9f61bf13
@ -148,17 +148,6 @@ class Settings extends APIEndpoint {
|
|||||||
$this->messageController->updateSuccessMessages();
|
$this->messageController->updateSuccessMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
$sendingMethodSet = $settings['mta']['method'] ?? null;
|
|
||||||
if ($sendingMethodSet === 'PHPMail') {
|
|
||||||
// check for valid mail function
|
|
||||||
$this->settings->set(DisabledMailFunctionNotice::QUEUE_DISABLED_MAIL_FUNCTION_CHECK, true);
|
|
||||||
} else {
|
|
||||||
// when the user switch to a new sending method
|
|
||||||
// do not display the DisabledMailFunctionNotice
|
|
||||||
$this->settings->set(DisabledMailFunctionNotice::QUEUE_DISABLED_MAIL_FUNCTION_CHECK, false);
|
|
||||||
$this->settings->set(DisabledMailFunctionNotice::OPTION_NAME, false); // do not display notice
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tracking and re-engagement Emails
|
// Tracking and re-engagement Emails
|
||||||
$meta['showNotice'] = false;
|
$meta['showNotice'] = false;
|
||||||
if ($oldSettings['tracking'] !== $this->settings->get('tracking')) {
|
if ($oldSettings['tracking'] !== $this->settings->get('tracking')) {
|
||||||
@ -374,6 +363,19 @@ class Settings extends APIEndpoint {
|
|||||||
$this->settingsChangeHandler->onMSSActivate($newSettings);
|
$this->settingsChangeHandler->onMSSActivate($newSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (($oldSendingMethod !== $newSendingMethod)) {
|
||||||
|
$sendingMethodSet = $newSettings['mta']['method'] ?? null;
|
||||||
|
if ($sendingMethodSet === 'PHPMail') {
|
||||||
|
// check for valid mail function
|
||||||
|
$this->settings->set(DisabledMailFunctionNotice::QUEUE_DISABLED_MAIL_FUNCTION_CHECK, true);
|
||||||
|
} else {
|
||||||
|
// when the user switch to a new sending method
|
||||||
|
// do not display the DisabledMailFunctionNotice
|
||||||
|
$this->settings->set(DisabledMailFunctionNotice::QUEUE_DISABLED_MAIL_FUNCTION_CHECK, false);
|
||||||
|
$this->settings->set(DisabledMailFunctionNotice::OPTION_NAME, false); // do not display notice
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Sync WooCommerce Customers list
|
// Sync WooCommerce Customers list
|
||||||
$oldSubscribeOldWoocommerceCustomers = isset($oldSettings['mailpoet_subscribe_old_woocommerce_customers']['enabled'])
|
$oldSubscribeOldWoocommerceCustomers = isset($oldSettings['mailpoet_subscribe_old_woocommerce_customers']['enabled'])
|
||||||
? $oldSettings['mailpoet_subscribe_old_woocommerce_customers']['enabled']
|
? $oldSettings['mailpoet_subscribe_old_woocommerce_customers']['enabled']
|
||||||
|
Reference in New Issue
Block a user