2

Has anyone experience in using php code in postmaster messages?

I am developing a weekly email using parcels and have tried to include code as simple as echoes and prints but there has been no output. Is there a preference somewhere that I can update?

1
  • This sounds like a bad idea. PHP in templates can open up security holes in your site. As Justin said, you should probably roll your PHP into a simple plugin, rather than using PHP directly in your email templates. – Adrian Macneil Feb 10 '13 at 1:50
2

I don't think PHP code in the email template works with my template parser. I need to test to be sure, but I don't think it works. I personally never use PHP in templates, instead I just roll anything I need into a simple plugin.

I can add this to list of things to add in the next release, but I don't have any ETA on v1.3.

2
  • Thanks for the response, what about embedding a separate php enabled template, is that allowable? – Conor Higgins Feb 8 '13 at 10:02
  • 1
    I never use PHP in templates. I always roll a plugin, so I have never tested any of that stuff. Feel free to try it and report back. – Justin Kimbrell Feb 8 '13 at 15:00
1

Investigated this further as suggested by Justin Kimbrell above. As it turns out, embedded a template which allows php leads to the message (at least in the preview) being broken and the processing of the message cuts out as soon as any information is echoed etc using the embed. I am now developing a plugin which I will have to use to print out the relevant information.

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.