How to handle GET parameters in the proper Drupal way I am working on a module that will handle the email subscription functions for our newsletters.

Email newsletters are sent out to subscribers with a link on them for them to unsubscribe. This link is in the format http://www.site.com/opt-out?email={email_address}. This is how the links are formatted and I can't change that. 

What is the proper way to deal with that parameter using Drupal? Of course I have access to $_GET['email'], but is this the proper way of accessing it in a Drupal module? What about input filtering? Should I just do a plain $email = filter_var($_GET['email'], FILTER_VALIDATE_EMAIL); ?
When faced with this url structure,  you can use $_GET in the usual PHP way. Drupal urls are usually generated with parameters separated by /, and as you probably know,  arg() is the right tool when this is the case.

As for the email validation, there are native functions that validate, but the validation is quite basic:

//check if this is a valid Drupal username
user_validate_name('USERNAME');

//check if this is a valid email address
user_validate_mail('test@test.com');


If you had to do this in a form, one can add validation functions where needed with hook_form_alter:

/**
 * Implementation of hook_form_alter().
 */function my_module_form_alter(&amp;$form, $form_state, $form_id)  {
 if ($form_id == 'user_profile_form') {
  array_unshift($form['#validate'], 'email_check_validate');
 }
}

/**
 * Validate profile form
 * Force form error if new email address matches current email address
 *
 */
function email_check_validate ($form, $form_state)  {
  global $user;
  $old_email = $user-&gt;mail;
  $new_email = $form_state['values']['mail'];

  if ($old_email ==  $new_email) {
    form_set_error('mail', t('Your email could not be changed'));
  }
}


But this does not apply in your case, it was just an example for when you need to do validation through a form.

Hope this helps, cheers!