Skip to content
Snippets Groups Projects
Commit d65e1a68 authored by Thom Wilhelm's avatar Thom Wilhelm
Browse files

Only send SMS if it is a mobile number, do not delete parent activity as it...

Only send SMS if it is a mobile number, do not delete parent activity as it might be shared between many users
parent a55b713b
Branches
Tags
No related merge requests found
......@@ -1515,7 +1515,12 @@ LEFT JOIN civicrm_case_activity ON ( civicrm_case_activity.activity_id = tbl.a
$tokenHtml = CRM_Utils_Token::replaceContactTokens($html, $values, TRUE, $messageToken, FALSE, $escapeSmarty);
$tokenHtml = CRM_Utils_Token::replaceHookTokens($tokenHtml, $values, $categories, TRUE, $escapeSmarty);
$smsParams['To'] = $values['phone'];
// Only send if the phone is of type mobile
if($values['phone_type_id'] == 2) {
$smsParams['To'] = $values['phone'];
}else{
$smsParams['To'] = '';
}
if (self::sendSMSMessage($contactId,
$tokenText,
......
......@@ -284,12 +284,10 @@ class org_civicrm_sms_clickatell extends CRM_SMS_Provider {
return $send[1];
}
else {
// delete any parent activity & throw error
if (CRM_Utils_Array::value('parent_activity_id', $header)) {
$params = array('id' => $header['parent_activity_id']);
CRM_Activity_BAO_Activity::deleteActivity($params);
}
return PEAR::raiseError($response['data']);
// TODO: Should add a failed activity instead.
CRM_Core_Error::debug_log_message($response['data']);
return;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment