I need to create an app that will allow users to create, edit and use e-mail templates. I have the idea of storing the templates in a MySQL DB with %1%, %2% etc for each part of the e-mail that needs to be replaced with user input and use str_replace on it. But I'm not how well this will work with users being able to create templates.
Has anybody creates something like this before? What do you believe will be the easiest way to go about it? It doesn't necessarily have to be stored as MySQL data, files on the server would be OK.
Regards,
Ideas for creating an e-mail template web app.
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
-
impulse()
- Forum Regular
- Posts: 748
- Joined: Wed Aug 09, 2006 8:36 am
- Location: Staffordshire, UK
- Contact:
I took your advice and used the filesystem to store the template contents but I had to use MySQL storage as far as I could see for storing how many substitutes words were in a template.
I used the idea of putting %1% where users wanted their first replacable word and then an increment of number for each one after that. I know it's not very user friendly but I didn't see many other ways to do it.
Thanks for the help though, Stephen
I used the idea of putting %1% where users wanted their first replacable word and then an increment of number for each one after that. I know it's not very user friendly but I didn't see many other ways to do it.
Thanks for the help though, Stephen
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Smarty is probably one of the most used template engines. Our own AKA Panama Jack has built Template Lite, which is similar, but lighter weight and has some added features.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA