Skip to content

Commit

Permalink
https://github.com/thehcginstitute-com/m1/issues/590
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed May 2, 2024
1 parent dfbcf7e commit ef634e5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class Ebizmarts_MailChimp_Model_Api_Subscribers_MailchimpTags {
* https://github.com/cabinetsbay/site/issues/589
* @used-by Ebizmarts_MailChimp_Model_Api_Customers::_buildMailchimpTags()
* @used-by Ebizmarts_MailChimp_Model_Api_Subscribers::_buildMailchimpTags()
* @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::processWebhookData()
* @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::p()
*/
function __construct() {
$this->setMailChimpHelper();
Expand Down Expand Up @@ -114,7 +114,7 @@ function getStoreId() {return $this->_storeId;}
function getSubscriber():Sub {return $this->_subscriber;}

/**
* @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::processWebhookData()
* @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::p()
* @param $data
* @param bool $subscribe
* @throws Mage_Core_Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ final class Ebizmarts_MailChimp_Model_ProcessWebhook {
* "Refactor `Ebizmarts_MailChimp_Model_ProcessWebhook`": https://github.com/cabinetsbay/site/issues/590
* @used-by Aoe_Scheduler_Model_Observer::dispatch() (app/code/community/Ebizmarts/MailChimp/etc/config.xml)
*/
function processWebhookData():void {
function p():void {
$collection = Mage::getModel('mailchimp/webhookrequest')->getCollection();
$collection->addFieldToFilter('processed', array('eq' => 0));
$collection->getSelect()->limit(self::BATCH_LIMIT);

foreach ($collection as $webhookRequest) {
$data = hcg_mc_h()->unserialize($webhookRequest->getDataRequest());

if ($data) {
switch ($webhookRequest->getType()) {
case 'profile':
Expand All @@ -40,7 +38,6 @@ function processWebhookData():void {
$this->_updateEmail($data);
}
}

$this->_saveProcessedWebhook($webhookRequest);
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ebizmarts/MailChimp/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ https://github.com/thehcginstitute-com/m1/issues/573 -->
<cron_expr>*/5 * * * *</cron_expr>
</schedule>
<run>
<model>Ebizmarts_MailChimp_Model_ProcessWebhook::processWebhookData</model>
<model>Ebizmarts_MailChimp_Model_ProcessWebhook::p</model>
</run>
<groups>ebizmarts_mailchimp</groups>
</mailchimp_process_webhook_data>
Expand Down
2 changes: 1 addition & 1 deletion app/code/local/HCG/MailChimp/lib/h/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
* @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::_clean()
* @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::_unsubscribe()
* @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::_updateEmail()
* @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::processWebhookData()
* @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::p()
* @used-by Ebizmarts_MailChimp_Model_System_Config_Backend_Active::makeHelper()
* @used-by Ebizmarts_MailChimp_Model_System_Config_Backend_Apikey::makeHelper()
* @used-by Ebizmarts_MailChimp_Model_System_Config_Backend_Ecommerce::makeHelper()
Expand Down

0 comments on commit ef634e5

Please sign in to comment.