Connect DaftareShoma webhook events to the Payam Resan SMS gateway through WordPress.
- 🔍 Overview
- ✅ Compatibility
- 🏗 Architecture
- ✨ Main Features
- 🔄 Supported Flow
- 🌐 Webhook Endpoint
- 📥 Installation
- ⚙️ Configuration Notes
- 📝 Logging
- 🧠 Technical Notes
- 📷 Screenshots
- 📄 License
SMS Webhook is a WordPress plugin that receives webhook events from DaftareShoma and sends SMS messages through the Payam Resan SMS gateway based on the received event status.
The plugin is designed for scenarios where an external service sends event information to a custom WordPress REST API endpoint. Based on configurable rules, the plugin determines whether an SMS should be sent and records the operation in its log files.
| Requirement | Version |
|---|---|
| WordPress | 5.0+ |
| PHP | 7.4+ |
flowchart LR
A["🏢 DaftareShoma"] --> B["📨 Webhook"]
B --> C["🌐 WordPress REST API"]
C --> D["✅ Validate Payload"]
D --> E{"📌 Event Match"}
E -->|Yes| F["📱 Send SMS"]
E -->|No| G["🚫 Ignore"]
F --> H["📝 Store Log"]
- Receives webhook requests through the WordPress REST API.
- Validates incoming JSON payloads.
- Supports both standard SMS and pattern-based SMS sending.
- Supports configurable recipient selection.
- Stores log files inside the WordPress uploads directory.
- Provides a dedicated settings page in the WordPress administration panel.
- A webhook request is sent to the WordPress endpoint.
- The plugin validates the request payload.
- If the configured event matches, an SMS is sent.
- The operation result is recorded in the log files.
The plugin registers the following REST endpoint.
POST /wp-json/sms-webhook/v1/incoming HTTP/1.1
Expected request fields include:
EventTypeCallerNumber
- Copy the plugin folder into the WordPress plugins directory.
- Activate the plugin from the WordPress administration panel.
- Open the plugin settings page.
- Configure your API credentials.
- Configure your message templates.
- Save your settings.
After installation:
- Enable SMS sending.
- Select the sending method (Standard or Pattern).
- Configure the recipient.
- Configure the SMS message.
- Select the event type that should trigger SMS sending.
All webhook requests and SMS sending results are stored in a dedicated directory inside the WordPress uploads folder.
This simplifies troubleshooting webhook delivery, validating incoming payloads and reviewing SMS delivery results.
📂 Log Directory
wp-content/uploads/sms-webhook-logs/
- Built on the WordPress REST API.
- Uses the WordPress HTTP API for sending SMS requests.
- Stores log files in a dedicated directory under the uploads folder.
- Validates and escapes all incoming data before processing.
SMS Webhook is free software released under the terms of the GNU General Public License v2.0 or any later version.
For more information, see the LICENSE file included with this plugin or the official GNU GPL v2 license.
