I have to code a Newsletter shipping hub in PHP. The DB architecture (which I can't change) is built like this:
Table:
<customer_prefix>_data
: Contains the data as XML Strings (with data such as customer name, email address, etc.) and the link to the tpl-Table. Each Row holds one customer email, plus further content which can change from newsletter to newsletter
Table:
<customer_prefix>_tpl
: Contains all the Newsletters (the HTML) with {$var}-Variables which should represent the XML-Nodes (and their data, so <node>value</node>
should become {$node} and this variable should hold 'value'). Plus the XSD Schema, with which the XML-Strings should be validated (I got that working).
The problem is, that the XML Strings can differ from Newsletter to Newsletter and everything has to happen dynamically (since I have to code a Cronjob that gathers all data, renders the mail content and then sends it). I've been told to use Smarty, but I dont know how to (DYNAMICALLY) convert the XML Nodes to Smarty Variables...
If there's a better way than using Smarty (str_replace is not an option), I'm all ears...
I hope you get my problem... If you need any further information, I'll be glad to provide them.