0

when We have add code like this in email form template then php code not working.

code like this.

{exp:email_from_template to="mailid" from="mailid"  echo="off" mailtype="html" }
     //php code $test= "hi"; 

    {exp:channel:entries channel="channel" dynamic="no" disable="pagination|member_data|categories" }

         //php code  echo $test; 

    {/exp:channel:entries}

 {/exp:email_form_template}

above code echo test not display , We have already set allow php ="yes" parse order="output" for template.

let me know any idea for this.

Thanks, Piyush

  • Does your email_from_template module actually return anything? – Derek Hogue May 28 '14 at 12:39
  • I assume the code posted above is not the actual code? Does non-PHP data get parsed correctly? – user1013 May 28 '14 at 13:16
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – Max Lazar May 28 '14 at 15:19
  • Since I cannot comment on the original post, how can I ask for clarification? – user1013 May 28 '14 at 15:45
2
php ="yes" parse order="output"

it is mean that php code is will be executed after all tags. Include fact that it will executed after email will sent.

You need to change it to input if you want to see php code results in your email.

as solution - put you code with php into embed template with parse order ="output"

| 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.