0

I have a db of coupons, and when they expire, I'd like to send an email to the customer saying it has expired, create a new one. What is the best way to do this? With a cron each day to check if it just expired? Or is there a good way to do it more "proactively"?

Andrew Samuelsen
  • 5,325
  • 9
  • 47
  • 69

1 Answers1

0

you could use a cron job to run a script that checks for expired entries, and then runs your email functions. But I have a feeling there is a nifty method using functions within you DB - are you using MySQL? Postgre, mssql.... ??

on looking, I think this page might help you: Invoking a PHP script from a MySQL trigger

Community
  • 1
  • 1
Nick
  • 908
  • 12
  • 29