email - Best practice to avoid "add friend" abuse -


I have a PHP / CodeIgniter site that has basic social functionality, which clearly includes a "add friend" link. When clicking on this link, an AJAX call is created in the background, which connects the user connected to the link as the user's link. In addition, the link changes to "remove friend", what does that mean on tin, the "add friend" method

When the "add friend" is clicked, the user is added as a friend, via e-mail that he has been added as a friend, this is where my question is Has arrived: If I click on the user to log in / delete / add / delete / etc, I would like to avoid the spamming of the user with the e-mail of these notifications.

Setting up my mind is an add history history table that records 2 user IDs and a timestamp. And if I (the current time - timestamp) is larger than a set value, then I will only send one e-mail. And every time a user reconnects a friend, then I update the timestamp for the current time, so that the validity of the spam control is "spread" with this method, I can also control that The user wants to add a lot of friends to a particular interval.

The price given in the past with records for records from this table periodically.

This is my view, if you have other or use different methods please share.

Thanks for reading.

The best option I think is simple, if possible, record all the time (Instead of checking on a timestamp), I will probably send emails, and then install the cron to settle the old people systematically - this way you can control a bit more time limit (your "limited "Logic cron will go to script, so you can decide Whether to remove the record or not, based on more complex parameters than just a timestamp - for example, if there is a particular user, to stop a very large activity, spammers. You also have user or account-type specific But I have the tendency to go overboard ...)

As far as I can tell, Facebook "Add Friend" -> "Pending Request ". From there, you can not do anything until you give the other person an answer, so you can not request for all spam, but I think if you need confirmation at the other end, And it is subject to your own taste.


Comments