Friday, June 29, 2007

Event Mailer

The spark happened when there was a discussion in the college group, "how prompt people are in sending birthday wishes". Somehow I am never prompt in this one. I wish to make a mark every time a wish is sent. Another reason is to kill the time when I get locked in office (happens during most of evenings). Thirdly wanted to have a hands-on on a couple of Java technologies which I know only conceptually.

Technologies Used:
JDK 1.5
JAXB
XML and XSD
Java Mail
Java Servlet
Apache Commons HTTPClient

Flow chart:
There are two parts to this project.

Getting the event list
1. Got the recurring birthday list from the Group Calendar
2. Converted it into a CSV file format
3. Used JAXB to create a events xml file from the CSV file

Sending the mailer
1. Read the events xml
2. Check for any events scheduled for today
3. Send out a request to Event mailer servlet with subject, message and mailId.
4. The event mailer servlet sends a mail

The events xsd is made generic such that it can span more than birthday list. I had to use event mailer servlet (hosted in myjavaserver), since could not make SMTP connections (I am behind the firewall). Made a cron job (using windows scheduler), to run the mailer everyday.

No comments: