Specifications
Solution Components
There are a number of components we will need to fulfil the requirements. The main ones are
setting up a database of lists, subscribers, and archived newsletters; uploading newsletters that
have been created offline; and sending mail with attachments.
Setting Up a Database of Lists and Subscribers
We will track the username and password of each system user, as well as a list of the lists they
have subscribed to. We will also store each user’s preference for receiving text or HTML
email, so we can send a user the appropriate version of the newsletter.
An administrator will be a specialized user with the ability to create new mailing lists and send
newsletters to those lists.
A nice piece of functionality to have for a system like this is an archive of previous newslet-
ters. Subscribers might not keep previous postings, but might want to look something up. An
archive can also act as a marketing tool for the newsletter as potential subscribers can see what
the newsletters are like.
Setting up this database in MySQL and an interface to it in PHP will have nothing new or
difficult in it.
File Upload
We need an interface to allow the administrator to send newsletters, as mentioned previously.
What we haven’t talked about is how administrators will create that newsletter. We could pro-
vide them with a form where they could type or paste the newsletter content. However, it will
increase the user-friendliness of our system to let administrators create a newsletter in their
favorite editor and then upload the file to the Web server. This will also make it easy for an
administrator to add images to an HTML newsletter.
For this we can use the file upload capability discussed in Chapter 16, “Interacting with the
File System and the Server.”
We will need to use a slightly more complicated form than we have used in the past. We will
require the administrator to upload both text and HTML versions of the newsletter, along with
any inline images that go into the HTML.
When the newsletter has been uploaded, we need to create an interface so that the administra-
tor can preview the newsletter before sending it. This way, he can confirm that all the files
were uploaded correctly.
Building a Mailing List Manager
C
HAPTER 28
28
BUILDING A
MAILING LIST
MANAGER
657
34 7842 CH28 3/6/01 3:46 PM Page 657