You are here

function sms_user_sms_send in SMS Framework 6.2

Same name and namespace in other branches
  1. 5 modules/sms_user/sms_user.module \sms_user_sms_send()
  2. 6 modules/sms_user/sms_user.module \sms_user_sms_send()
  3. 7 modules/sms_user/sms_user.module \sms_user_sms_send()

Implementation of hook_sms_send().

File

modules/sms_user/sms_user.module, line 96
Provides integration between the SMS Framework and Drupal users.

Code

function sms_user_sms_send(&$number, &$message, &$options, &$gateway) {
  if (variable_get('sms_user_sleep', 1) && ($uid = sms_user_get_uid($number))) {
    $account = user_load(array(
      'uid' => $uid,
      'status' => 1,
    ));
    if (!empty($account->sms_user['sleep_enabled']) && _sms_user_sleep_active($account)) {
      unset($gateway['send']);
      watchdog('sms', 'Message was not sent to @user due to sleep settings.', array(
        '@user' => $account->name,
      ));
    }
  }
}