SMS Framework is an implementation of Symfony Notifiers' SMS component.
Documentation
Many service integrations are provided, including: 46elks, AllMySms, Amazon SNS, Bandwidth, Brevo, Clickatell, ContactEveryone, Esendex, Fake SMS (for testing), FreeMobile, GatewayApi, GoIP, Infobip, Iqsms, iSendPro, KazInfoTeh, LightSms, LOX24, Mailjet, MessageBird, MessageMedia, Mobyt, Nexmo, Octopush, OrangeSms, OvhCloud, Plivo, Primotexto, Redlink, RingCentral, Sendberry, Sendinblue, Sms77, SimpleTextin, Sinch, Sipgate, SmsSluzba, Smsapi, Smsbox, SmsBiuras, Smsc, SMSense, SMSFactor, SpotHit, Sweego, Telnyx, TurboSms, Twilio, Unifonic, Vonage, Yunpian.
The dispatch of messages, including the mapping of recipients to users is provided by Notifier. Notifier and Messenger provide a way to send messages asynchronously (i.e, queues; outside of the web request). Its also possible to implement your own SMS service, or customise any of the services provided by Symfony by implementing Texter services.
SMS Framework provides other SMS related features, such as
API examples
Sending an SMS:
// Sending to a user/entity.
/** @var \Drupal\sms\PhoneNumber\SmsPhoneNumberInterface $phoneNumberService */
$phoneNumberService = \Drupal::service(\Drupal\sms\PhoneNumber\SmsPhoneNumberInterface::class);
$user = User::load(1);
$notification = (new Notification())->subject('Test message');
$phoneNumberService->send($user, $notification)
Or directly to a phone number:
// Sending to a user/entity.
/** @var \Symfony\Component\Notifier\NotifierInterface $notifier */
$notifier = \Drupal::service(\Symfony\Component\Notifier\NotifierInterface::class);
$recipient = new \Symfony\Component\Notifier\Recipient\Recipient(
phone: '+123123123',
);
$notification = (new Notification())->subject('Test message');
$notifier->send($notification, $recipient);