Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Can't Explode String In Email Template Or Snippet Rate Topic   - - - - -

 

Posted 13 October 2020 - 02:27 PM #1

Hello all,

 

So i have two codes i want to send to my customers after their order has been shipped

The codes are stored in a variable in $order_info as a string in this form: "code1|code2"

 

The thing is that i have noticed that the smarty in the email templates is VERY limited 

Thus i can't do for example {'|'|explode:$order_info.myCodes} to access them

 

Can anyone think of a solution?

Thanks



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11808 posts

Posted 13 October 2020 - 04:05 PM #2

I'm confused by your question.

The newer email environment that uses documents and snippets uses TWIG

The older (better) template based system uses SMARTY.

 

The smarty environment is pretty much unrestricted.  The twig environment on the other hand is locked down and you need to change the twig configuration for the whole site to identify the list of php functions that you want available as filters in twig.  I believe they refer to it as adding custom filters.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 

Posted 14 October 2020 - 09:59 AM #3

I'm confused by your question.

The newer email environment that uses documents and snippets uses TWIG

The older (better) template based system uses SMARTY.

 

The smarty environment is pretty much unrestricted.  The twig environment on the other hand is locked down and you need to change the twig configuration for the whole site to identify the list of php functions that you want available as filters in twig.  I believe they refer to it as adding custom filters.

You are probably right, i mistook twig for smarty

Thank you now i have a handle to do more research

 

If somebody knows more about twig in this context i'd appreciate some help