[eluser]err403_love[/eluser]
Keep the templates HTML-only, but build a phrasing system such that a user can modify all the default phrases.
You'll need a phrases table with something like phraseid, variable (actual text you evaluate in the template), text, and possibly a column for the user and time it was modified. Taking it even further you could have a 'phrasetype' column (default/custom, keeping the originals in the DB for reverting to), a 'language' column for multilingual support, and so on.
Then in the templates it could appear, for example:
Code:
Dear <?=$username?>,
<?=$confirmation_msg?>
And instead of it actually parsing it as PHP, your app would use 1 query to grab all the phrases needed on that page and display them appropriately.
Of course, in the example above, your username needs to be dynamic, so you need some kind of a separation for the method in which the "phrases" are parsed.
So instead you could do:
Code:
Dear <?=$username?>,
<?phrase=$confirmation_msg?>
So anything in the normal PHP shorthand would be parsed correctly, and the "phrase" tags would be replaced with the associated phrase in the database.
This way you could also provide support for entire languages. Have somebody localize it, and then it becomes a simple SQL file that a person can upload in the admin section of their CMS.