CRM-15718 - Bulk sms: Check for do not send sms instead of is opt out
authoratif-shaikh <shaikh388@gmail.com>
Fri, 26 Dec 2014 05:42:32 +0000 (11:12 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Fri, 26 Dec 2014 05:42:32 +0000 (11:12 +0530)
https://issues.civicrm.org/jira/browse/CRM-15718

CRM/Mailing/BAO/MailingJob.php

index 3c7fb2b9c9c482ba4fef0b618452261ad44813be..3b25917a93036bcaa3d650118560ba5bd2f5b528 100644 (file)
@@ -539,7 +539,8 @@ VALUES (%1, %2, %3, %4, %5, %6, %7)
                     WHERE       $eqTable.job_id = " . $this->id . "
                         AND     $edTable.id IS null
                         AND     $ebTable.id IS null
-                        AND    $contactTable.is_opt_out = 0";
+                        AND    ( $contactTable.is_opt_out = 0
+                        OR       $contactTable.do_not_sms = 0 )";
     }
     $eq->query($query);
 
@@ -634,7 +635,7 @@ VALUES (%1, %2, %3, %4, %5, %6, %7)
     $returnProperties = $mailing->getReturnProperties();
     $params           = $targetParams = $deliveredParams = array();
     $count            = 0;
-    
+
     /**
      * CRM-15702: Sending bulk sms to contacts without e-mail addres fails.
      * Solution is to skip checking for on hold