Lorenzo S
Lorenzo S

Reputation: 1397

Magento/Mailchimp integration, import fails

I am currently trying to debug a syncronization process Magento -> Mailchimp, that does not work. Ebizmarts/MageMonkey/etc/config.xml has this cron job-related configuration:

<magemonkey_bulksync_import_subscribers>
      <schedule><cron_expr>0 * * * *</cron_expr></schedule>
      <run><model>monkey/cron::processImportJobs</model></run>
</magemonkey_bulksync_import_subscribers>

So the task is scheduled to be executed every hour. Now, I can clearly see from a script that I wrote for my Magento store that the status of my task is "pending". Then, once the task is executed, the status becomes "success" with the message "Ebizmarts_MageMonkey_Model_Cron". The problem is that the sync is not done. So, to debug what happens, I've added some Mage::log() lines in the processImportJobsmethod, like this:

public function processImportJobs()
{
            $job = $this->_getJob('Import');
            Mage::log("importing");
            if(is_null($job)){
                    Mage::log("IS NULL!");
                    return $this;
            }
...

And if fact, I can see "importing IS NULL!" in the log, so this is why is not synced, I guess. The _getJob method is:

    protected function _getJob($entity)
    {
            $job = Mage::getModel("monkey/bulksync{$entity}")
                                    ->getCollection()
                                    ->addFieldToFilter('status', array('IN' => array('idle', 'chunk_running') ))
                                    ->addOrder('created_at', 'asc')
                                    ->load();
            if(!$job->getFirstItem()->getId()){
                    return null;
            }

            return $job->getFirstItem();
    }

So it seems like my cron job status should be 'idle' or 'chunk_running' to be executed, and it's not.

Any hints? Thanks

Upvotes: 0

Views: 1220

Answers (1)

user1527661
user1527661

Reputation: 11

Have you followed the steps explained in Ebizmarts wiki? How Can I sync subscribers in MailChimp with Magento

Kind regards, Santiago

Upvotes: 1

Related Questions