0

we set up cron job as below . it was working until we installed module to send Abandoned cart emails.

enter image description here

when we run http://sitename.com:81/cron.php, we get error as :

Fatal error: Call to a member function getTemplate() on a non-object in  

$tpl = $this->getDesign()->getTemplate();

function , full code : http://pastebin.com/gewZSRrp

public function getProcessedTemplate($variables = null)
    {
        $tpl = $this->getDesign()->getTemplate();

        $result = $this->_render($tpl, $variables);

        if ($this->getDesign()->getTemplateType() == Extension_EmailDesign_Model_Design::TEMPLATE_TYPE_HTML) {
            $result = Mage::helper('emaildesign')->styleHtml($result);
        }

        return $result;
    }

Edit

public function getDesign()
    {
        if ($this->_design == null && $this->getDesignId()) {
            $this->_design = Mage::getModel('emaildesign/design')->load($this->getDesignId());
        }

        return $this->_design;
    }

Edit 2

sometimes below result

enter image description here

sometimes below result :

enter image description here

Strange is link : http://sbdev2.kidsdial.com:81/cron.php will show above Fatal error sometimes and no error after some times. But no abandoned cart email is sent.....

  • there is nothing called getDesignId() in your code thats why $this->getDesign() returns Null – Gopal Patel Mar 23 '17 at 7:13
  • @GopalPatel please check updated question or full file code here : pastebin.com/gewZSRrp – Baby in Magento Mar 23 '17 at 7:15
  • I go through that code already thats why I am saying it returns null and you are trying to call ->getTemplate(); on null – Gopal Patel Mar 23 '17 at 7:17
  • @GopalPatel Thanks a lot for your time and help, i need your support like this in upcoming days also..... – Baby in Magento Mar 24 '17 at 7:58
0

For sending emails, we are creating Templates and we are creating Triggers and assign that template to Triggers.

We deleted some triggers, that is the reason cron didt worked,

Solution : Deleting all those "scheduled Mails" from database will help to run cron job again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.