Page 1 of 1

creating templates

Posted: Fri Sep 21, 2007 2:43 am
by shivam0101
How to create email templates and newsletter templates?

The admin can add, edit, delete them.

Thanks

Posted: Fri Sep 21, 2007 3:07 am
by s.dot
I'm not sure I understand the question.

You would create a template just like you would any other page. HTML/CSS. With place holders for the info that changes.

Posted: Fri Sep 21, 2007 3:12 am
by aceconcepts
If I understand your question you could create an "admin" page that allows users to create email "templates" using an editor such as FCKEditor or TinyMCE. These editors will create the HTML for you which can then be stored in a database as email templates.

In order to include dynamic content, simply add it to the source code.

When you want to send an email you can call a template and set it as the $message in mail().

Posted: Fri Sep 21, 2007 3:34 am
by shivam0101
aceconcepts, you are right. Thats what i want. Instead of users admin himself create it. Later on he will select one of it and use it.

You mean to say only the html will be sent in message?

Should i have to add tags like header, footer, body etc? What dynamic content should he be given to add... i am confused

Posted: Fri Sep 21, 2007 4:56 am
by aceconcepts
What I mean by dynamic content is content that is not static/constant i.e. date, person's name you are sending the email to.

All the editor will do for you is format the content you enter with HTML tags

e.g. if you enter something like "Hello this is a test email" as plain text without any additional formatting such as bold the editor will format your entry so that it looks like this:

Code: Select all

<p>Hello this is a test email</p>
In order to add dynamic content simply edit the source code ("Source" is provided on editor toolbar sets) and insert the PHP $variables you want.

e.g. When you edit the source code to add your $variables it will look something like this:

Code: Select all

<p>Hello <? echo $name_of_person; ?> this is a test email</p>
The value of variable $name_of_person will be picked up from your PHP scripted used to send the mail.

Does this help?