Forum OpenACS Development: Re: HELP ME!!

Collapse
2: Re: HELP ME!! (response to 1)
Posted by Matthew Geddert on
you create a package-procs-init.tcl file that checks to see if the date is in there and then stuff it in acs_mail_lite. i would look at the acs-mail-lite/tcl/ directory to see how the init file runs a proc to pull everything out of the acs_mail_lite_queue table... all you would need to do is tell it to create a message and not delete it from your birth date table. you won't need to run it every 60 seconds like acs-mail-lite, but maybe once every few hours. I would then keep track of the people that have been notified in a custom table for that - so if it finds an upcoming birthday it stuffs a message into that table that says that person has been notified, that way you can tell your script to query for all dates in the next 24 hours for (note this is postgresql code, i don't know what oracle needs), i.e.:

select * from your_table where birth_date < timestamp + '1 day' and birth_date > timestamp

If it were me and i were designing the app, i would email the people two days in advance to remind them that it is their friends birthday (i.e. so they can get a last minute gift) and then another message on their birthday.