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 b3e4702 commit 78b0745
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ function __construct() {
$this->_interestGroupHandle = Mage::getModel('mailchimp/api_subscribers_InterestGroupHandle');
}

function deleteProcessed():void {
$helper = $this->getHelper();
$resource = $helper->getCoreResource();
$connection = $resource->getConnection('core_write');
$tableName = $resource->getTableName('mailchimp/webhookrequest');
$where = array("fired_at < NOW() - INTERVAL 30 DAY AND processed = 1");
$connection->delete($tableName, $where);
}

/**
* 2024-05-02 Dmitrii Fediuk https://upwork.com/fl/mage2pro
* "Refactor `Ebizmarts_MailChimp_Model_ProcessWebhook`": https://github.com/cabinetsbay/site/issues/590
Expand Down Expand Up @@ -167,15 +176,6 @@ private function _unsubscribe(array $data):void {
*/
function _profile(array $data):void {$this->getMailchimpTagsModel()->processMergeFields($data);}

function deleteProcessed():void {
$helper = $this->getHelper();
$resource = $helper->getCoreResource();
$connection = $resource->getConnection('core_write');
$tableName = $resource->getTableName('mailchimp/webhookrequest');
$where = array("fired_at < NOW() - INTERVAL 30 DAY AND processed = 1");
$connection->delete($tableName, $where);
}

private function _getStoreId()
{
return Mage::app()->getStore()->getId();
Expand Down

0 comments on commit 78b0745

Please sign in to comment.