From 39373d13920ecfec6cb8025a3c2c98fa9bd4b3ff Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Tue, 7 Oct 2014 15:16:43 -0400 Subject: [PATCH] CRM-15426 - record SMS errors ---------------------------------------- * CRM-15426: Errors when sending Bulk SMS messages are not recorded any where https://issues.civicrm.org/jira/browse/CRM-15426 --- CRM/Mailing/BAO/MailingJob.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Mailing/BAO/MailingJob.php b/CRM/Mailing/BAO/MailingJob.php index 8f5c02e515..22524f7152 100644 --- a/CRM/Mailing/BAO/MailingJob.php +++ b/CRM/Mailing/BAO/MailingJob.php @@ -693,7 +693,6 @@ VALUES (%1, %2, %3, %4, %5, %6, %7) unset($errorScope); } - // FIXME: for now we skipping bounce handling for sms if (is_a($result, 'PEAR_Error') && !$mailing->sms_provider_id) { // CRM-9191 $message = $result->getMessage(); @@ -737,6 +736,13 @@ VALUES (%1, %2, %3, %4, %5, %6, %7) ); CRM_Mailing_Event_BAO_Bounce::create($params); } + elseif (is_a($result, 'PEAR_Error') && $mailing->sms_provider_id) { + // Handle SMS errors: CRM-15426 + $job_id = intval($this->id); + $mailing_id = intval($mailing->id); + CRM_Core_Error::debug_log_message("Failed to send SMS message. Vars: mailing_id: ${mailing_id}, job_id: ${job_id}. Error message follows."); + CRM_Core_Error::debug_log_message($result->getMessage()); + } else { /* Register the delivery event */ $deliveredParams[] = $field['id']; -- 2.25.1