class CRM_Mailing_Form_Test extends CRM_Core_Form {
/**
- * Function to set variables up before form is built
+ * Set variables up before form is built
*
* @return void
* @access public
}
/**
- * This function sets the default values for the form.
+ * Set default values for the form.
*
* @access public
*
/**
* Form rule to send out a test mailing.
*
- * @param array $params Array of the form values
- * @param array $files Any files posted to the form
- * @param array $self an current this object
+ * @param aray $testParams
+ * @param array $files Any files posted to the form
+ * @param array $self an current this object
*
* @return boolean true on successful SMTP handoff
* @access public
$testParams['emails'][] = $email;
$emails .= $emails ? ",'$email'" : "'$email'";
if (!CRM_Utils_Rule::email($email)) {
- CRM_Core_Session::setStatus(ts('Please enter a valid email addresses.'), ts('Test not sent.'), 'error');
+ CRM_Core_Session::setStatus(ts('Please enter a valid email address.'), ts('Test not sent.'), 'error');
$error = TRUE;
}
}
AND e.on_hold = 0
AND c.is_opt_out = 0
AND c.do_not_email = 0
+AND c.is_deleted = 0
AND c.is_deceased = 0
GROUP BY e.id
ORDER BY e.is_bulkmail DESC, e.is_primary DESC
$dao->free();
foreach ($testParams['emails'] as $key => $email) {
- $email = trim($email);
+ // Email addresses are forced to lower case when saved, so ensure
+ // we have the same case when comparing.
+ $email = trim(strtolower($email));
$contactId = $emailId = NULL;
if (array_key_exists($email, $emailDetail)) {
$emailId = $emailDetail[$email]['email_id'];