You are here

function pet_validate_emails in Previewable email templates 6

Same name and namespace in other branches
  1. 7 includes/pet.admin.inc \pet_validate_emails()

Parse a list of emails and return errors if any.

2 calls to pet_validate_emails()
pet_add_form_validate in ./pet.admin.inc
Validate the PET. Could do better callback and token type validation
pet_user_form_validate in ./pet.admin.inc
Validate PET form.

File

./pet.admin.inc, line 624
Contains administrative pages for creating, editing, and deleting previewable email templates (PETs).

Code

function pet_validate_emails($mail_text) {
  $errors = array();
  foreach (pet_parse_mails($mail_text) as $mail) {
    if (!valid_email_address($mail)) {
      $errors[] = t('Invalid email address found: %mail.', array(
        '%mail' => $mail,
      ));
    }
  }
  return $errors;
}