php - adding an opt-out function to a mailing list application -


I want to add an opt-out function to customers who receive mail.

I am a PHP n00b, so the best way I can understand is to send a link to a form where they will write their email, so I can remove it from the database through a query when They submit it

Is there any more elegant way? How can I remove the database by simply clicking on the opt-out link to the user?

On the lines of the following should be something simple and secure.

Send a link to the user with a query string containing your email (or better, email ID if you have generated) and salty hash of their emails when the user clicks on the link, script email And use the salt to verify a specific email and then remove it from the DB.

The reason for using salt is with email (or email id) so that people do not try to use the link with the predictive email and erase them.


Comments