You are here

class MessageNotifierSMS in Message Notify 7.2

@file SMS notifier.

Hierarchy

Expanded class hierarchy of MessageNotifierSMS

1 string reference to 'MessageNotifierSMS'
sms.inc in plugins/notifier/sms/sms.inc

File

plugins/notifier/sms/MessageNotifierSMS.class.php, line 8
SMS notifier.

View source
class MessageNotifierSMS extends MessageNotifierBase {
  public function deliver(array $output = array()) {
    if (empty($this->message->smsNumber)) {

      // Try to get the SMS number from the account.
      $account = user_load($this->message->uid);
      if (!empty($account->sms_user['number'])) {
        $this->message->smsNumber = $account->sms_user['number'];
      }
    }
    if (empty($this->message->smsNumber)) {
      throw new MessageNotifyException('Message cannot be sent using SMS as the "smsNumber" property is missing from the Message entity or user entity.');
    }
    return sms_send($this->message->smsNumber, strip_tags($output['message_notify_sms_body']));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MessageNotifierBase::$message protected property The message entity.
MessageNotifierBase::$plugin protected property The plugin definition.
MessageNotifierBase::access public function Determine if user can access notifier. Overrides MessageNotifierInterface::access
MessageNotifierBase::postSend public function Act upon send result. Overrides MessageNotifierInterface::postSend
MessageNotifierBase::send public function Entry point to send and process a message. Overrides MessageNotifierInterface::send
MessageNotifierBase::__construct public function Constructor for the notifier. Overrides MessageNotifierInterface::__construct
MessageNotifierSMS::deliver public function Deliver a message via the required transport method. Overrides MessageNotifierBase::deliver