Details
Description
I've installed the extension for Twilio to send SMS'es, and it works fine when sending single SMS'es as an action, for example through the action button when viewing a contact.
If I want to send Mass SMSes, though, it doesn't work. I can create and schedule the Mass SMS just fine, and the "Send scheduled SMS"-job finishes without error, but zero SMS'es are send (the job-log also reflects that).
The cause of this is an error in the function create in CRM/Mailing/BAO/Mailing.php. On line 1755 getRecipients are called without the last argument $mode, and getRecipients are executed as if it's an email and not an SMS:
// Populate the recipients.
if (empty($params['_skip_evil_bao_auto_recipients_'])) {
self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email);
}
Suggested solution:
// Populate the recipients.
if (empty($params['_skip_evil_bao_auto_recipients_'])) {
// check if it's an sms
$mode = $mailing->sms_provider_id ? 'sms' : NULL;
self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
}
I've tested this on 4.6.8 and it works for me.
See http://civicrm.stackexchange.com/questions/403/why-cant-i-send-bulk-sms-even-though-i-can-send-individually/6805#6805 for further info.