You are here

public function SmsEventSubscriber::createAccount in SMS Framework 2.x

Same name and namespace in other branches
  1. 8 modules/sms_user/src/EventSubscriber/SmsEventSubscriber.php \Drupal\sms_user\EventSubscriber\SmsEventSubscriber::createAccount()
  2. 2.1.x modules/sms_user/src/EventSubscriber/SmsEventSubscriber.php \Drupal\sms_user\EventSubscriber\SmsEventSubscriber::createAccount()

Process an incoming SMS to see if a new account should be created.

Parameters

\Drupal\sms\Event\SmsMessageEvent $event: The event.

File

modules/sms_user/src/EventSubscriber/SmsEventSubscriber.php, line 40

Class

SmsEventSubscriber
Event subscriber responding to SMS Framework events.

Namespace

Drupal\sms_user\EventSubscriber

Code

public function createAccount(SmsMessageEvent $event) {
  foreach ($event
    ->getMessages() as $sms_message) {
    $this->accountRegistration
      ->createAccount($sms_message);
  }
}