I also would like to provide a possibility to unsubscribe without to require the user to log in.
I would like to have it like this:
User clicks the Unsubscribe link in the email and is taken to a new page lets say
This page has a form with only one field where the user enters the email-address
he wants to unsubscribe. (Similar like the email password page.)
If he clicks "send" the database IS NOT immediately updated by setting the
"UserSubscribed" field to 0 - like suggested in the post before.
Instead an email is sent to the entered email-address:
If you want to unsubscribe from the list please click here: "Unsubscribe-Link"
If this link is clicked the appropriate email will be subscribed by updating the database
setting the "UserSubscribed" field to 0.
(The step sending an email to the entered email-address is important, so that
no one can unsubsubscribe an email that doesn't belong to them!)
My Question is:
How should be the code of this last "Unsubscribe-Link" to achieve the result of
finding the right email address in the database and setting the "UserSubscribed"
field to 0 ?