How to allow users unsubscribe without logging in by changing the value of a custom field? I have a Drupal 7 site with a checkbox (Boolean field) that users check on registration to receive promotional emails.

However, Gmail started blocking some of my emails because they want every email to have a link that users can click to unsubscribe without logging in.

The first idea that came to mind is to link to a webform and then process the unsubscriptions manually, which doesn't sound like any fun.
This can be solved using the form API.


Define a path using hook_menu().
Define an unsubscribe form for the menu path.
Write a validation handler to check the email address.
Write a submit handler for the form.