|
Posted by BLob on 10/21/02 11:34
Hello,
I am building a system to deal with inscriptions to events. There is a
backoffice which allows administrators to send emails to all or to a sub-set
of the participants. The administrators can enter the text of the emails,
using a template-like syntax to add fields from the database. For example :
"Dear {title} {first_name} {last_name}" will produce "Dear John Doe". But I
would need to add a degree in the way emails can be personalised, with if
.... elseif ... elseif ... else ... clauses.
For example :
{if (transport = 'train')}
We noted that you will come by train + instructions to come from the
train station.
{elseif (transport = 'plane')}
We noted that you will fligh to Paris + instructions to come....
{elseif (transport = 'car')}
Blablabla....
{endif}
I could use PHP syntax for the content of the mail and just eval( ) it or do
something like that, but I don't want to allow anything else than if ...
elseif ... else ... clauses. I could also use a template system (Smarty) but
for many reasons I don't use any of those anymore.
Can you give me an idea about how to do this ?
Thanks,
BLob
Navigation:
[Reply to this message]
|