Further cases of case-insensitive checking for "send test email" in mailings
authorMartin <martinh@peaceworks.ca>
Fri, 4 Jan 2019 15:36:42 +0000 (15:36 +0000)
committerMartin <martinh@peaceworks.ca>
Fri, 4 Jan 2019 15:36:42 +0000 (15:36 +0000)
api/v3/Mailing.php

index 73eabba4774ebd72a3e378ec48bdf98637de6833..a31641730a8192417e7922566e0668385a40509a 100644 (file)
@@ -637,7 +637,7 @@ function civicrm_api3_mailing_send_test($params) {
     $query = CRM_Utils_SQL_Select::from('civicrm_email e')
         ->select(array('e.id', 'e.contact_id', 'e.email'))
         ->join('c', 'INNER JOIN civicrm_contact c ON e.contact_id = c.id')
-        ->where('e.email IN (@emails)', array('@emails' => $testEmailParams['emails']))
+        ->where('LOWER(e.email) IN (@emails)', array('@emails' => $testEmailParams['emails']))
         ->where('e.on_hold = 0')
         ->where('c.is_opt_out = 0')
         ->where('c.do_not_email = 0')
@@ -650,7 +650,7 @@ function civicrm_api3_mailing_send_test($params) {
     $emailDetail = array();
     // fetch contact_id and email id for all existing emails
     while ($dao->fetch()) {
-      $emailDetail[$dao->email] = array(
+      $emailDetail[strtolower($dao->email)] = array(
         'contact_id' => $dao->contact_id,
         'email_id' => $dao->id,
       );