0

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.

0

This can be solved using the form API.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.