Drupal is a registered trademark of Dries Buytaert

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);

Support #

Support is provided in the issue queue or Drupal Slack in the #sms channel.

Installation #

Download the project with composer require drupal/sms. Non-Composer installations are strictly not supported.

Versions

Version 4

New users of the project or users seeking new features should use Version 4. Version 4 is a complete architecture of the project and is a better choice for long term support and technical resilience.

Version 2

The latest version of v2 permits Drupal 10 and 11. v3 and v4 permit Drupal 11 and later only. v2 is unsupported.

Version 2 users should upgrade to V3 for long term support. V3 primarily includes changes to PHP typing and class finalization. There is no long term plan for V3 support as yet, so please evaluate Version 4 at your earliest convenience.

A list of changes for users upgrading from 2 to 3, and new 4 users can be found at https://www.drupal.org/project/smsframework/issues/3492832.

Upgrading from v2/3 to v4

When upgrading from version 2 or 3 to 4, you must uninstall the project first. There is no automatic upgrade path. Gateway integration and configuration will need to be converted to the new services. Entity/user verification carry forward as there are no schema changes. Take a table dump of the sms verification table before uninstalling, then re-import the data.

Integrations

Documentation

Activity

Total releases
5
First release
Dec 2024
Latest release
11 months ago
Release cadence
22 days
Stability
40% stable

Release Timeline

Releases

Version Type Release date
4.0.0-beta1 Pre-release Mar 5, 2025
4.x-dev Dev Feb 25, 2025
3.0.x-dev Dev Dec 10, 2024
2.3.0 Stable Dec 9, 2024
2.4.0 Stable Dec 9, 2024