Summary
Currently, the SMSAPI module only supports the Polish SMSAPI.pl service. The underlying PHP library (smsapi/php-client) supports multiple regions:
- smsapi.pl - Poland
- smsapi.com - International (217 countries)
- smsapi.se - Sweden
- smsapi.bg - Bulgaria
This feature request adds a configuration option to select the service region, enabling international SMS support.
Problem
The module hardcodes smsapiPlService() in all service calls, making it impossible to use international SMSAPI.com accounts.
Proposed Solution
Add a new configuration option smsapi_service_region that allows selecting between PL, COM, SE, and BG services.
Changes
- config/schema/smsapi.schema.yml - Add
smsapi_service_regionschema - config/install/smsapi.settings.yml - Add default value 'PL' for backward compatibility
- src/Form/ConfigurationForm.php - Add region selector dropdown
- src/Services/SmsapiService.php - Add
getService()helper method that returns the correct service based on configuration
Backward Compatibility
The default value is 'PL', so existing installations will continue working without any changes.
Testing
- Apply the patch
- Go to /admin/config/system/smsapi
- Select "International (smsapi.com)" from the new dropdown
- Enter your SMSAPI.com token
- Test sending an SMS
Related Links
Issue fork smsapi-3569589
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
krystianbrzoza commentedThanks for your contribution.
Functionality added in version 1.3.0