[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] How to send reminder email??
Alma Nuker <alma@youramigo.com> writes:
> I am trying to work out how to send an reminder email?? For example
> I want to send reminder email for maintenence 20 days before it is
> due as well as 5 days before maintenenace is due.
I'm guessing this is annual maintenance? This would obviously require
a modification the the default catalogs; but, not really a problem.
You would just need to have a new column in the userdb for the
maintenance date (you could even make this a comma separated list).
Then when the order is placed make a modification to the order routing
to update that column of the database. Then write a cron job
(external to IC) that would go through every night and mail out
notifications.
This might be a good time to put in a plug for the Date::Manip perl
module. It lets you do cool things like:
$maintenance = ParseDate("3/20/2002"); # or any other convenient
# format
if (!Date_Cmp($maintenance, DateCalc("today", "+ 5 days"))) {
# dates are equal
# mail out 5 day reminder
} elsif (!Date_Cmp($maintenance, DateCalc("today", "+ 20 days"))) {
# dates are equal
# mail out 20 day reminder
}
--
(__) Doug Alcorn (mailto:doug@lathi.net http://www.lathi.net)
oo / PGP 02B3 1E26 BCF2 9AAF 93F1 61D7 450C B264 3E63 D543
|_/ If you're a capitalist and you have the best goods and they're
free, you don't have to proselytize, you just have to wait.