August 4, 2004

New version of the Assignment Calculator: Now with email reminder functionality!

Many of you have asked for the code that the U of M uses to send email reminders to people that want to be reminded when different steps of the research process are due for their assignments. Well, here it is! I sincerely hope that these instructions will make sense, but there is a possibility that you will have some questions regarding setting up this new AC version. If you have any questions, please use the comments function of this blog entry so that everyone may benefit from your question, and hopefully the answer!

These instructions are based on the use of a MySQL database. If you are using another type of database please consider sharing any modifications necessary to get the AC to work.

Now all you need to do is download the new zip file for the new version of the AC. This new version obviously has some changes to the existing files and also adds some files:

  1. The file instructions.php has two new functions: connect_db() -- to connect to the database you have set up and mailme() -- the function that actually sends out the emails.
  2. The file date.php has a new for() loop that generates the button that says "Submit for email reminders!" and also at the bottom of the file are the functions that send out the emails. In other words, date.php is the trigger that sends the emails out. Obvioulsy this could also be done with a chron job, but at the University of Minnesota the AC gets used so much emails are sent regularly on a daily basis. However, if your AC doesn't get used everyday, you should probably go the chron job route.
  3. There is a new file called mailme.phtml. This is a simple form for the user to fill out his/her email address and the name of his/her assignment.
  4. Another new file is called mail.phtml. This file inserts the emails into the database and is the action of the mailme.phtml script above.
  5. Finally, we have delmail.phtml. This file deletes the mail from the database if a user doesn't want to receive it anymore. This option appears in emails that the user has already received.

In order to install this new version of the Assignment Calculator follow these (hopefully) simple instructions. You will need:

  1. Access to a PHP enabled web server. If you aren't sure if you have access or if you aren't sure you have a PHP enabled web server, talk with your server administrator.
  2. The ability to create a new web directory on your server. There are 9 files that come in the this version of the Assignment Calculator with Email Reminders. For the initial installation, all of these files must reside in the same directory on your server.
  3. There is no need to know PHP, but you will want to change or configure the file called "instructions.php." This file holds the information for the time limits for each step as well as the text and links for each step of your institution's preferred research process.
  4. Create the database that will hold the email dates waiting to be sent. Create a database named "calculator." Inside of that database create a table called "calc_mail." Here is what it should look like:

    | Field  | Type           | Null | Key | Default | Extra       |
    |mail_id |int(5) unsigned |     |PRI |NULL    |auto_increment |
    |datum   |varchar(8)      |YES  |    |NULL    |               |
    |step    |char(2)         |     |    |        |               |
    |email   |varchar(100)    |     |    |        |               |
    |name    |varchar(255)    |     |    |        |               |

    This is where the email reminders will reside. You will also need to give your web server access to insert data into this table.

  5. Open instructions.php and find the function connect_db(). Alter this function to use the database criteria you have just set up.
  6. That should be all you need to do. Go ahead and give it a try!

Again, if you have any problems please leave a comment. However, if they are problems dealing with your database you may need to solve those on your own! If you want to give it a try before you download, I have installed and configured it so that you can both calculate and send your self some emails.

Good luck!

Posted by snackeru at August 4, 2004 4:04 PM