From 014cb8c85a370bc28f97ab25a6e7f5539620c935 Mon Sep 17 00:00:00 2001
From: yashodha <yashodha.chaku@webaccessglobal.com>
Date: Tue, 27 Oct 2015 13:57:40 +0530
Subject: [PATCH] CRM-17331: Mass SMSes are not being sent, even though send
 schedules SMS -job completes without errors

----------------------------------------
* CRM-17331: Mass SMSes are not being sent, even though "send schedules SMS"-job completes without errors
  https://issues.civicrm.org/jira/browse/CRM-17331
---
 CRM/Mailing/BAO/Mailing.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php
index 44f4bee041..120807b024 100644
--- a/CRM/Mailing/BAO/Mailing.php
+++ b/CRM/Mailing/BAO/Mailing.php
@@ -1747,7 +1747,9 @@ ORDER BY   civicrm_email.is_bulkmail DESC
 
       // Populate the recipients.
       if (empty($params['_skip_evil_bao_auto_recipients_'])) {
-        self::getRecipients($job->id, $mailing->id, TRUE, $mailing->dedupe_email);
+        // check if it's sms
+        $mode = $mailing->sms_provider_id ? 'sms' : NULL;
+        self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
       }
     }
 
-- 
2.25.1