Answers.Body: <p>Allowing arbitrary php to be executed from an email string can potentially cause security issues from un-trusted users and hence the security mode of smarty is enabled for all string based resources.</p>
  
  <p>I dont think there is an easy work-around for this :(</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-14T09:31:04.047Z
Answers.Text: Thank's for your answer I will try with Smarty functions alone
Answers.UserDisplayName: matthias de mauroy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-09T16:08:15.897Z
Answers.LastActivityDate: 2015-04-09T16:08:15.897Z
Answers.UserDisplayName: Donald Lobo
Body: <p>I hope my silly question will get answers from some of you...</p>
  
  <p>I'm just trying to send an email using smarty basics functions such as using {php} tags and playing php in smarty tags {if strstr($email, '@')}.</p>
  
  <p>But each time I try to send the template Smarty activate secure_mode and everything's ruined...</p>
  
  <p>I found where Smarty put the secure_mode but I can't understand why... (in CRM/Core/Smarty.php line 202).</p>
  
  <p>If someone ever run into this and solved it pleeeease help me  :'(</p>
  
  <p>PS : I defined this in my settings file => define( 'CIVICRM_MAIL_SMARTY', 1 );</p>
  
  <p>Still working on it !</p>
  
  <p>I hope i'll find the solution  ;D</p>
  
Tags: <email><smarty>
Title: How to prevent Smarty secure_mode activation?
ThreadText: # How to prevent Smarty secure_mode activation?
  
  (Asked by: username_0 on 2015-04-09)
  
  I hope my silly question will get answers from some of you...
  
  I'm just trying to send an email using smarty basics functions such as using {php} tags and playing php in smarty tags {if strstr($email, '@')}.
  
  But each time I try to send the template Smarty activate secure\_mode and everything's ruined...
  
  I found where Smarty put the secure\_mode but I can't understand why... (in CRM/Core/Smarty.php line 202).
  
  If someone ever run into this and solved it pleeeease help me :'(
  
  PS : I defined this in my settings file => define( 'CIVICRM\_MAIL\_SMARTY', 1 );
  
  Still working on it !
  
  I hope i'll find the solution ;D
  
  **Tags:** email, smarty
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-04-09. Score: 2 | Accepted answer
  
  Allowing arbitrary php to be executed from an email string can potentially cause security issues from un-trusted users and hence the security mode of smarty is enabled for all string based resources.
  
  I dont think there is an easy work-around for this :(
  
  > **Comments:**
  > **username_0**: Thank's for your answer I will try with Smarty functions alone  
  
  ---
  
  