# SMS Twilio Extension for Paymenter
A comprehensive SMS extension for Paymenter that allows you to send SMS messages to your customers using the Twilio API. Features advanced template system, retry functionality, and complete SMS management.
##
Features
## Installation
### Step 1: Copy Extension Files
Copy the entire
# Copy to Paymenter extensions directory
### Step 2: Install Dependencies
### Step 3: Enable Extension
1. Go to your Paymenter admin panel
2. Navigate to Extensions
3. Find "SMS Twilio" in the list
4. Click "Enable"
### Step 4: Configure Settings
1. Go to Extensions → SMS Twilio → Settings
- Send Notifications Via: Select Whatsapp / SMS or Both
- Enter Whatsapp Number or SMS Number
2. Enter your Twilio credentials:
- Twilio Account SID: Your Twilio Account SID
- Twilio Auth Token: Your Twilio Auth Token
- Twilio Phone Number: Your Twilio phone number (e.g., +1234567890)
- Twilio Messaging Service SID: (Optional) Your Messaging Service SID for better delivery
### Step 5: Access SMS Interface
1. Go to Admin Panel → Communication → Send SMS
2. Start sending SMS messages to your customers
##
Usage
### Sending Individual SMS
1. Go to Admin Panel → Communication → Send SMS
2. Click "Send SMS" button
3. Select a user from the dropdown
4. Enter phone number (if different from user's phone)
5. Choose a template or write a custom message
6. Fill in template variables (if using a template)
7. Click "Create" to send
### Creating SMS Templates
1. Go to Admin Panel → Communication → SMS Templates
2. Click "Create Template"
3. Fill in template details:
- Template Name: e.g., "Welcome Message"
- Subject: Brief description
- Message Content: Use variables like {name}, {amount}, {date}
- Variables: Define available variables
4. Save the template
### Using Template Variables
Templates support dynamic variables:
Example template:
Welcome {name}! Your order #{order_id} for {amount} has been confirmed. Thank you for choosing {company}!
Retrying Failed Messages
1. Go to Admin Panel → Communication → Send SMS
2. Find failed messages (marked with red status)
3. Click the "Retry" button next to the failed message
4. The system will attempt to resend the SMS[/COLOR]
## Configuration
The extension uses Paymenter's built-in configuration system. All settings are managed through the Extensions interface in your admin panel.
Database
The extension creates two tables:
##
Requirements
##
Advanced Features
### Template Variables System
### Retry Mechanism
### Delivery Tracking
### User Experience Improvements
##
Troubleshooting
### Common Issues
1. SMS /Whatsapp not sending:
- Check Twilio credentials in extension settings
- Verify phone number format (+1234567890)
- Check Twilio account balance
2. Template variables not working:
- Ensure JSON format is correct:
- Check variable names match template placeholders
3. Character count not updating:
- Refresh the page
- Check browser console for JavaScript errors
4. "Sent from your Twilio trial account" message:
- This is automatically added by Twilio for trial accounts
- Upgrade to a paid Twilio account to remove this message
- Add payment method in Twilio Console → Billing
### Debug Information
Access debug information at:
##
Support
For support with this extension:
1. Check the SMS logs for error messages
2. Verify your Twilio account status and balance
3. Ensure your Twilio credentials are correct
4. Check Paymenter logs for any errors
5. Use the debug route for configuration verification
Contact me via discord
https://discord.com/users/777176916431470652
##
License
This extension is licensed under the MIT License.[/CODE][/COLOR]
A comprehensive SMS extension for Paymenter that allows you to send SMS messages to your customers using the Twilio API. Features advanced template system, retry functionality, and complete SMS management.
##
Multi-Channel Messaging
- Send notifications via:
- SMS only
- WhatsApp only
- Both SMS & WhatsApp
- Unified “Send Notifications Via” dropdown for easy control
- Dedicated WhatsApp number field (falls back to SMS number if not provided)
Automated Notifications
Customer Notifications
- Invoice created
- Invoice marked as paid
- New user registration (welcome message)
- Service activation / provisioning
- Service suspension (non-payment)
- Service cancellation request
- Admin replies to support tickets
Admin Notifications
- New support tickets
- Service cancellation requests
Smart Template System
- Create and manage reusable SMS/WhatsApp templates
- Dynamic variables (e.g., {name}, {amount}, {service})
- Separate templates for each event type
- Enable/disable notifications per event from admin settings
Messaging Features
- Send individual SMS messages to customers
- WhatsApp messaging via Twilio WhatsApp API
- Real-time character count for SMS messages
- Automatic fallback to SMS when WhatsApp number is not available
Reliability & Control
- Retry failed messages with one click
- Built-in rate limiting to prevent abuse
- Delivery tracking via Twilio
Logging & Management
- Complete SMS/WhatsApp activity logs
- Full audit trail of all notifications
- Admin phone number configuration for internal alerts
Seamless Integration
- Clean integration with Paymenter’s extension architecture
- Easy setup and configuration
- Designed for scalability and maintainability
## Installation
### Step 1: Copy Extension Files
Copy the entire
SmsTwilio folder to your Paymenter extensions directory:# Copy to Paymenter extensions directory
Bash:
cp -r SmsTwilio/ /path/to/paymenter/extensions/Others/
### Step 2: Install Dependencies
Bash:
cd /path/to/paymenter
composer require twilio/sdk
### Step 3: Enable Extension
1. Go to your Paymenter admin panel
2. Navigate to Extensions
3. Find "SMS Twilio" in the list
4. Click "Enable"
### Step 4: Configure Settings
1. Go to Extensions → SMS Twilio → Settings
- Send Notifications Via: Select Whatsapp / SMS or Both
- Enter Whatsapp Number or SMS Number
2. Enter your Twilio credentials:
- Twilio Account SID: Your Twilio Account SID
- Twilio Auth Token: Your Twilio Auth Token
- Twilio Phone Number: Your Twilio phone number (e.g., +1234567890)
- Twilio Messaging Service SID: (Optional) Your Messaging Service SID for better delivery
### Step 5: Access SMS Interface
1. Go to Admin Panel → Communication → Send SMS
2. Start sending SMS messages to your customers
##
### Sending Individual SMS
1. Go to Admin Panel → Communication → Send SMS
2. Click "Send SMS" button
3. Select a user from the dropdown
4. Enter phone number (if different from user's phone)
5. Choose a template or write a custom message
6. Fill in template variables (if using a template)
7. Click "Create" to send
### Creating SMS Templates
1. Go to Admin Panel → Communication → SMS Templates
2. Click "Create Template"
3. Fill in template details:
- Template Name: e.g., "Welcome Message"
- Subject: Brief description
- Message Content: Use variables like {name}, {amount}, {date}
- Variables: Define available variables
4. Save the template
### Using Template Variables
Templates support dynamic variables:
- {name}: Customer name
- {email}: Customer email
- {amount}: Payment amount
- {date}: Current date
- {company}: Your company name
- {order_id}: Order number
- {invoice_id}: Invoice number
Example template:
Welcome {name}! Your order #{order_id} for {amount} has been confirmed. Thank you for choosing {company}!
Retrying Failed Messages
1. Go to Admin Panel → Communication → Send SMS
2. Find failed messages (marked with red status)
3. Click the "Retry" button next to the failed message
4. The system will attempt to resend the SMS[/COLOR]
## Configuration
The extension uses Paymenter's built-in configuration system. All settings are managed through the Extensions interface in your admin panel.
The extension creates two tables:
ext_sms_logs: Stores SMS activity logs and delivery statusext_sms_templates: Stores reusable SMS templates with variables
##
- PHP 8.1+
- Paymenter 1.3+ , 1.4+
- Twilio Account with SMS / Whatsappcapabilities
- Twilio SDK (installed via Composer)
##
### Template Variables System
- Create dynamic templates with placeholders
- Replace variables with actual data when sending
- Support for JSON format variable input
- Real-time character counting with live updates
- Automatic variable replacement in messages
### Retry Mechanism
- One-click retry for failed messages
- Automatic error logging
- Status tracking (pending, sent, failed)
### Delivery Tracking
- Track SMS delivery status via Twilio
- Store Twilio Message SID for reference
- Error message logging for failed deliveries
### User Experience Improvements
- Intuitive Interface: "Send SMS" instead of "Create SMS"
- Auto-redirect: Automatically returns to SMS list after sending
- Hidden Status Field: Status is managed automatically behind the scenes
- Real-time Feedback: Live character counting and instant notifications
- Clean Form: No unnecessary fields cluttering the interface
##
### Common Issues
1. SMS /Whatsapp not sending:
- Check Twilio credentials in extension settings
- Verify phone number format (+1234567890)
- Check Twilio account balance
2. Template variables not working:
- Ensure JSON format is correct:
{"name": "John", "amount": "$99"}- Check variable names match template placeholders
3. Character count not updating:
- Refresh the page
- Check browser console for JavaScript errors
4. "Sent from your Twilio trial account" message:
- This is automatically added by Twilio for trial accounts
- Upgrade to a paid Twilio account to remove this message
- Add payment method in Twilio Console → Billing
### Debug Information
Access debug information at:
/admin/sms/debug##
For support with this extension:
1. Check the SMS logs for error messages
2. Verify your Twilio account status and balance
3. Ensure your Twilio credentials are correct
4. Check Paymenter logs for any errors
5. Use the debug route for configuration verification
Contact me via discord
https://discord.com/users/777176916431470652
##
This extension is licensed under the MIT License.[/CODE][/COLOR]

- Automatic SMS - We will plan this in next release
- Event based SMS - We will plan this in next release