function engagements_can_send_sms_to_number

7.x engagements.module engagements_can_send_sms_to_number($phone_number)
6.x engagements.module engagements_can_send_sms_to_number($phone_number)
2 calls to engagements_can_send_sms_to_number()
engagements_form_alter in modules/engagements/engagements.module
Implements hook_form_alter
engagements_mass_sms_perform_batch_operation in modules/engagements/engagements.module

File

modules/engagements/engagements.module, line 1541
This is the primary module file for the engagements module.

Code

function engagements_can_send_sms_to_number($phone_number) {
  $phone_number = engagements_convert_to_valid_phone_number($phone_number);
  if (!$phone_number) {
    return FALSE;
  }

  $mid = db_result(db_query("SELECT mid FROM sms_do_not_txt WHERE phone_number = ?", array($phone_number)));

  // We found an entry in this table, so NO, we cannot txt this number.
  if ($mid) {
    return FALSE;
  }

  // else
  return TRUE;


}