src/EventListener/SMSMessengerListener.php line 17

Open in your IDE?
  1. <?php 
  2. namespace App\EventListener;
  3. use App\Entity\Applicant;
  4. use Boab\CmsBundle\Sms\SMSGatewayInterface;
  5. class SMSMessengerListener
  6. {
  7.     private SMSGatewayInterface $smsGateway;
  8.     public function __construct(SMSGatewayInterface $smsGateway)
  9.     {
  10.         $this->smsGateway $smsGateway;
  11.     }
  12.     public function onParticipantRegistered(Applicant $applicant):void
  13.     {
  14.         dump('SMS HIT');
  15.         //$participant = $event->getParticipant();
  16.         $smsMessenger $this->smsGateway->create('mnotify');
  17.         $smsResponse $smsMessenger->send($applicant->getTelephoneNumber(), sprintf("Hi %s, We appreciate your participation in the NEIP/World Bank accelerated program.
  18.         Your application is being considered, and we'll let you know when it's ready for the next step"$applicant->getFirstName()));
  19.     }    
  20. }