$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,
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;
}
}
}