seven.io / craft
Send SMS and make text-to-speech calls via seven
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 1
Type:craft-plugin
Requires
- craftcms/cms: ^3.1.0
- sms77/api: ^2.3.0
This package is auto-updated.
Last update: 2025-10-02 12:36:14 UTC
README
Official Craft CMS + Commerce Plugin
Send SMS and voice (text-to-speech) messages directly from your Craft CMS control panel or programmatically via service APIs.
Features
-
SMS Messaging
- Send individual SMS via control panel
- Programmatic SMS API with fluent interface
- Bulk SMS to Craft Commerce customers
- Advanced options: delay, flash SMS, performance tracking, custom labels
-
Voice Messaging
- Send individual voice calls via control panel
- Programmatic voice API with fluent interface
- Bulk voice calls to Craft Commerce customers
- Text-to-speech with XML support
-
Craft Commerce Integration (optional)
- Bulk messaging to all customers
- Country-based filtering
- Automatic phone number extraction from customer addresses
Prerequisites
- Craft CMS 3.1.5 or later
- An API key from seven.io
- (Optional) Craft Commerce 2.x for bulk messaging features
Installation
Install via Composer:
# Navigate to your Craft project root cd /path/to/your/craft-project # Install the plugin composer require seven.io/craft # Install via Craft CLI ./craft install/plugin seven
Alternatively, install from the Craft Plugin Store.
Configuration
- Navigate to Settings → seven in your Craft control panel
- Enter your seven.io API key (required)
- Optionally set a default sender ID/from number (max 16 characters)
Usage
Control Panel
Access the plugin via the main navigation:
- seven SMS - Send individual or bulk SMS messages
- seven Voice - Send individual or bulk voice calls
For bulk messaging with Craft Commerce, leave the recipient field empty and optionally filter by country.
Programmatic Usage
Send SMS
use Seven\Craft\Plugin; $instance = Plugin::getInstance(); $sms = $instance->getSms(); $sms->params ->setTo('+4901234567890') // Required: recipient(s), comma-separated ->setText('Your message here') // Required: message text ->setFrom('YourCompany') // Optional: sender ID (max 16 chars) ->setDelay('2024-12-31 23:59') // Optional: scheduled delivery ->setFlash(true) // Optional: flash SMS ->setLabel('campaign-2024') // Optional: custom label ->setPerformanceTracking(true); // Optional: enable tracking $success = $sms->send(); // Returns true on success, false on failure
Send Voice Call
use Seven\Craft\Plugin; $instance = Plugin::getInstance(); $voice = $instance->getVoice(); $voice->params ->setTo('+4901234567890') // Required: recipient(s), comma-separated ->setText('Your message here') // Required: message text (TTS) ->setFrom('YourCompany') // Optional: caller ID ->setXml(false) // Optional: XML mode ->setJson(true); // Optional: JSON response $success = $voice->send(); // Returns true on success, false on failure
Available Parameters
SMS Parameters (via SmsParams
):
setTo(string)
- Recipient phone number(s), comma-separatedsetText(string)
- Message textsetFrom(string)
- Sender ID (alphanumeric, max 16 chars)setDelay(string)
- Scheduled delivery timestampsetFlash(bool)
- Send as flash SMSsetForeignId(string)
- Custom foreign IDsetJson(bool)
- JSON response formatsetLabel(string)
- Custom label for trackingsetPerformanceTracking(bool)
- Enable performance tracking
Voice Parameters (via VoiceParams
):
setTo(string)
- Recipient phone number(s), comma-separatedsetText(string)
- Text-to-speech messagesetFrom(string)
- Caller IDsetXml(bool)
- XML modesetJson(bool)
- JSON response format
Error Handling
The send()
method returns a boolean:
true
- Message sent successfully (API response code 100)false
- Sending failed (logged via Craft's error handler)
Check Craft logs for detailed error messages.
Craft Commerce Bulk Messaging
When Craft Commerce is installed, you can send messages to all customers:
- Navigate to seven SMS or seven Voice
- Leave the recipient field empty
- Optionally select countries to filter recipients
- Enter your message and send
The plugin automatically extracts phone numbers from customer billing/shipping addresses.
API Response Codes
100
- Success- Other codes indicate errors (see seven.io API documentation for details)
Support
Need help? Contact us:
- Email: support@seven.io
- Website: seven.io/en/company/contact
- Issues: GitHub Issues