Ways to prevent multiple email notification with php&mysql

Posted by Louis Loudog Trottier on Stack Overflow See other posts from Stack Overflow or by Louis Loudog Trottier
Published on 2012-10-18T04:57:17Z Indexed on 2012/10/18 5:01 UTC
Read the original article Hit count: 144

Filed under:
|
|

My 1st post, but i got many great answers and tips from stackoverflow so far. This one was a close call-> How does facebook, gmail send the real time notification? but not exactly, so let brainstorm this together.

I have CMS system with mail notification when a change is made on the site. Everything wotk very well but i want to prevent multiple notification if somene make another quick change to, let say, fix a typo. Using php mail(), obviously.

I've tough of 2 ways, one simple, and one.... let just say, pretty heavy... cough. the 3rd one was inspired by Implementing Email Notification but really doesn't look appealing to me to send bunch of email at once.

  1. Use a timestamp to check if another change was made in the 'let say' last 5 minutes.

  2. Record the last change, and compare it to the new one. Could be usefull for backup at the same time since i'll have to save the change somewhere, but text can be long and making an sql search would be painfull. Wouldn't it?

  3. Use cron to send changes every x minutes... convince me if you ythink it is a suitable solution.

Any ideas, comment or suggestion of your own? Looking forward for your inputs, and since i now registered, i'll do my best to help around.

Cheers, all llt

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql