Email Template Engine

Hello

I want to send mail with Email Template Engine feature , How can I do this easily ?

I want to save templates in database and replace some fields and send mail , my question is about how to replace fields? Here is my email template that contains all my needs




Dear {fullname}

Here is new products list

{foreach products as product}

    ID :{product.id}

    name :{product.name}

{/foreach}



I just need a simple template engine class that apply to my template string( not template file)

thanks

any idea?

:( Still Waiting for reply !

You can use php platform function strtr.

Find more here: http://php.net/manual/en/function.strtr.php

With this function I can just replace variable , How can I have loop?