You are here

public function DefaultSmsProvider::processDeliveryReport in SMS Framework 8

Same name and namespace in other branches
  1. 2.x src/Provider/DefaultSmsProvider.php \Drupal\sms\Provider\DefaultSmsProvider::processDeliveryReport()
  2. 2.1.x src/Provider/DefaultSmsProvider.php \Drupal\sms\Provider\DefaultSmsProvider::processDeliveryReport()

Handles delivery reports pushed to the site.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The HTTP request that contains the delivery report.

\Drupal\sms\Entity\SmsGatewayInterface $gateway: The gateway designated to process the delivery report.

Overrides SmsProviderInterface::processDeliveryReport

File

src/Provider/DefaultSmsProvider.php, line 146

Class

DefaultSmsProvider
The SMS provider that provides default messaging functionality.

Namespace

Drupal\sms\Provider

Code

public function processDeliveryReport(Request $request, SmsGatewayInterface $sms_gateway) {
  $response = new Response();
  $reports = $sms_gateway
    ->getPlugin()
    ->parseDeliveryReports($request, $response);
  $event = new SmsDeliveryReportEvent();
  $event
    ->setResponse($response)
    ->setReports($reports);
  $this->eventDispatcher
    ->dispatch(SmsEvents::DELIVERY_REPORT_POST_PROCESS, $event);
  return $event
    ->getResponse();
}