You are here

function sms_send in SMS Framework 6.2

Same name and namespace in other branches
  1. 5 sms.module \sms_send()
  2. 6 sms.module \sms_send()
  3. 7 sms.module \sms_send()

Sends a message using the active gateway.

Parameters

$number: The destination number.

$message: The text of the messsage to send.

$options: An array of dditional properties as defined by gateway modules.

5 calls to sms_send()
sms_actions_send_action in modules/sms_actions/sms_actions.module
Implementation of a Drupal action.
sms_sendtophone_form_submit in modules/sms_sendtophone/sms_sendtophone.module
sms_send_form_submit in ./sms.module
Form submission handler for sms_send_form().
sms_user_send in modules/sms_user/sms_user.module
Send a message to a user.
sms_user_send_confirmation in modules/sms_user/sms_user.module

File

./sms.module, line 161
The core of the SMS Framework. Provides gateway managment and API for sending and receiving SMS messages.

Code

function sms_send($number, $message, $options = array()) {
  $gateway = sms_default_gateway();
  foreach (module_implements('sms_send') as $module) {
    $function = $module . '_sms_send';
    $function($number, $message, $options, $gateway);
  }
  $response = NULL;
  if (function_exists($gateway['send'])) {
    $response = $gateway['send']($number, $message, $options);
  }
  $result = sms_handle_result($response, $number, $message);

  // Post process hook
  foreach (module_implements('sms_send_process') as $module) {
    $function = $module . '_sms_send_process';
    $function('post process', $number, $message, $options, $gateway, $result);
  }
  return $result;
}