Skip to content
This repository has been archived by the owner on Jun 1, 2018. It is now read-only.

Commit

Permalink
Added control to listBatchSubscribe.
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiagoebizmarts committed Apr 10, 2015
1 parent e44d452 commit fab65e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/code/community/Ebizmarts/MageMonkey/Model/Cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,9 @@ public function sendSubscribersAsync()
$oldList = $newList;
}
if ($newList != $oldList || $eachIsConfirmNeed != $isConfirmNeed) {
Mage::getSingleton('monkey/api')->listBatchSubscribe($oldList, $batch, $isConfirmNeed, TRUE, FALSE);
if(count($bach) > 0) {
Mage::getSingleton('monkey/api')->listBatchSubscribe($oldList, $batch, $isConfirmNeed, TRUE, FALSE);
}
$isConfirmNeed = $eachIsConfirmNeed;
$oldList = $newList;
$batch = array();
Expand All @@ -530,7 +532,7 @@ public function sendSubscribersAsync()
//$email = $item->getEmail();
//Mage::getSingleton('monkey/api')->listSubscribe($listId, $email, $mergeVars, 'html', $isConfirmNeed);
$item->setProcessed(1)->save();
if ($item->getId() == $collection->getLastItem()->getId()) {
if ($item->getId() == $collection->getLastItem()->getId() && count($batch) > 0) {
Mage::getSingleton('monkey/api')->listBatchSubscribe($oldList, $batch, $isConfirmNeed, TRUE, FALSE);
}
}
Expand Down

0 comments on commit fab65e4

Please sign in to comment.