You are here

function mass_contact_mail_page_validate in Mass Contact 6

Same name and namespace in other branches
  1. 5.2 mass_contact.module \mass_contact_mail_page_validate()
  2. 5 mass_contact.module \mass_contact_mail_page_validate()
  3. 7 mass_contact.page.inc \mass_contact_mail_page_validate()

Validates the main Mass Contact mail form.

Parameters

form: An associative array containing the structure of the form.

form_state: A keyed array containing the current state of the form.

File

./mass_contact.module, line 1409
This is the main code file for the Mass Contact module. This module enables users to contact multiple users through selected roles.

Code

function mass_contact_mail_page_validate($form, &$form_state) {
  if (!$form_state['values']['cid']) {
    form_set_error('cid', t('You must select a valid category.'));
  }
  if (variable_get('mass_contact_default_sender_changable', 0) == 1 && !valid_email_address($form_state['values']['mail'])) {
    form_set_error('mail', t('You must enter a valid e-mail address.'));
  }
}