You are here

function pet_validate_emails in Previewable email templates 7

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

Parse a list of emails and return errors if any.

1 call to pet_validate_emails()
pet_user_form_validate in includes/pet.admin.inc
Validate PET form.

File

includes/pet.admin.inc, line 544
Contains 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;
}