Reply to Personalised e-mails with if clauses

Your name:

Reply:


Posted by BLob on 10/23/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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация