webform_yuboto
A Drupal module that provides a Webform handler to send SMS messages using the Yuboto SMS API. See more at the Yuboto Messaging Platform.
The latest Yuboto API version tested with this module is v1.10 (as of 2026-03-02).
Features
- Send SMS messages to webform submission phone numbers
- Configurable message templates with token support
- Global API key configuration through Drupal UI
- Support for custom sender names
- Comprehensive error handling and logging
Requirements
- Drupal 9, 10, or 11
- Webform module
- Yuboto SMS API account and API key
Configuration
1. Configure API Keys
Navigate to Administration > Configuration > Services > Yuboto SMS Settings (/admin/config/services/webform-yuboto):
Note: Access to this configuration page requires the "Administer Webform Yuboto SMS settings" permission, which should be granted to trusted administrators only.
Environment Control:
- The enable/disable toggle allows you to temporarily disable SMS sending without uninstalling the module, perfect for staging environments
- The debug mode toggle provides different error handling behaviors for development vs. production environments
Phone Number Validation: The module automatically validates and normalizes Greek mobile phone numbers:
- Only accepts Greek mobile numbers starting with
69 - 10-digit numbers (
6912345678) are automatically prefixed with30 - 12-digit numbers with country code (
306912345678) are accepted as-is - All normalized phone numbers use the format
3069XXXXXXXX(without + prefix) - Invalid numbers are rejected and logged but don't interrupt form submission (unless debug mode is enabled)
2. Configure Webform Handler
- Edit your webform
- Go to Settings > Handlers > Add handler
- Select Yuboto SMS from the list
- Configure the handler settings:
- Phone number field: Select the form field that contains the phone number
- SMS Message: Enter the message to send (supports tokens) or leave to use the default
- Sender Name: Enter the sender name for the SMS or leave to use the default
Token Support
You can use the following tokens in your message and sender fields:
-
Webform tokens:
[webform:title],[webform:id] -
Submission tokens:
[webform_submission:value:field_name],[webform_submission:serial] -
Site tokens:
[site:name],[site:slogan],[current-user:name] -
Global tokens:
[current-date:custom:Y-m-d], etc.
API Request Format
The module sends requests to Yuboto API using Basic Authentication with your API key as the Basic auth credentials.
HTTP Request Format:
- Method: POST
-
URL:
https://services.yuboto.com/omni/v1/Send -
Headers:
Content-Type: application/json; charset=utf-8 Accept: application/json Authorization: Basic
Request Body:
{
"dir": "false",
"contacts": [
{
"phonenumber": "3069XXXXXXXX"
}
],
"sms": {
"sender": "[site:name]",
"text": "Thank you for your submission",
"validity": 1440,
"typesms": "sms",
"long_sms": false,
"priority": 1
}
}
Future plans
- Add support for webform submission with multiple phone numbers
- Extend the API to support Viber
- Extend the API to support more API call verbs (not only Send)
- Consider splitting the Yuboto API to a standalone module