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:


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. May 27, 2016 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 May 27, 2016 at 12:10
  • in the config the blocks field is loaded. The attribute value it should be correct. Do you have some suggestion ? May 27, 2016 at 12:49

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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