- Fixes sending limits not being enforced

This commit is contained in:
Vlad
2016-08-06 19:04:10 -04:00
parent 0e10f6c820
commit bf00e82596
3 changed files with 31 additions and 25 deletions

View File

@@ -8,11 +8,9 @@ if(!defined('ABSPATH')) exit;
class Mailer {
public $mailer;
public $mailer_log;
function __construct() {
$this->mailer = $this->configureMailer();
$this->mailer_log = $this->getMailerLog();
}
function configureMailer(array $newsletter = null) {
@@ -42,9 +40,8 @@ class Mailer {
return MailerLog::getMailerLog();
}
function updateMailerLog() {
$this->mailer_log['sent']++;
return MailerLog::updateMailerLog($this->mailer_log);
function updateSentCount() {
return MailerLog::incrementSentCount();
}
function getProcessingMethod() {
@@ -63,10 +60,4 @@ class Mailer {
$prepared_subscribers
);
}
function enforceSendingLimit() {
if(MailerLog::isSendingLimitReached()) {
throw new \Exception(__('Sending frequency limit has been reached'));
}
}
}