You are here

public function ScheduleAware::send in SMS Framework 2.1.x

Same name and namespace in other branches
  1. 8 tests/modules/sms_test_gateway/src/Plugin/SmsGateway/ScheduleAware.php \Drupal\sms_test_gateway\Plugin\SmsGateway\ScheduleAware::send()
  2. 2.x tests/modules/sms_test_gateway/src/Plugin/SmsGateway/ScheduleAware.php \Drupal\sms_test_gateway\Plugin\SmsGateway\ScheduleAware::send()

Sends an SMS.

Parameters

\Drupal\sms\Message\SmsMessageInterface $sms: The sms to be sent.

Return value

\Drupal\sms\Message\SmsMessageResultInterface The result of the sms messaging operation.

Overrides Memory::send

File

tests/modules/sms_test_gateway/src/Plugin/SmsGateway/ScheduleAware.php, line 31

Class

ScheduleAware
Defines a gateway which is aware of scheduled send time.

Namespace

Drupal\sms_test_gateway\Plugin\SmsGateway

Code

public function send(SmsMessageInterface $sms) {
  if ($sms instanceof SmsMessageEntityInterface) {
    return parent::send($sms);
  }
  else {
    throw new \Exception('Not a SMS message entity');
  }
}