2

This is how I call a custom phtml file in the trans.email content:

{{block type='core/template' area='frontend' template='foldername/myfile.phtml' order=$order}}

and its working perfect. But I want to include a block where I will do the logic and in the phtml file I just want to call the needed function from my block. I tried the following:

{{block type='mynamespace_mymodule/email_pdflink' area='frontend' template='foldername/myfile.phtml' order=$order}}

and this is the content of the block:

class Mynamespace_Mymodule_Block_Email_Pdflink extends Mage_Core_Block_Template
{
    public function test()
    {
        return 13;
    }
}

and the content of the myfile.phtml:

$this->test();

Even if a write a simple html code in the myfile.phtml file it doesn't show up in the content of my trans. email. Any idea how to solve this ? thx

  • Please paste the code for your config.xml as well. – Anshu Mishra May 27 '16 at 12:09
  • May be the error is the line {{block type='mynamespace_mymodule/email_pdflink' area='frontend' template='foldername/myfile.phtml' order=$order}} type attribute – Anshu Mishra May 27 '16 at 12:10
  • in the config the blocks field is loaded. The attribute value it should be correct. Do you have some suggestion ? – Attila Naghi May 27 '16 at 12:49
0

What you need to do is allow the custom class directive for your block in System > Permissions > Blocks

Just add the class directive and set to 1.

I was implementing something similar recently and it has to do with a recentish patch (SUPEE-6788). Spent some time testing and going crazy until I realized this was the issue.

More information can be found on the mage site about the patch https://magento.com/security/patches/supee-6788-technical-details

| improve this answer | |

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.