Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

📨 SMS Webhook


Payam Resan       DaftareShoma

Connect DaftareShoma webhook events to the Payam Resan SMS gateway through WordPress.


📚 Table of Contents


🔍 Overview

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.


✅ Compatibility

Requirement Version
WordPress 5.0+
PHP 7.4+

🏗 Architecture

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"]
Loading

✨ Main Features

  • 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.

🔄 Supported Flow

  1. A webhook request is sent to the WordPress endpoint.
  2. The plugin validates the request payload.
  3. If the configured event matches, an SMS is sent.
  4. The operation result is recorded in the log files.

🌐 Webhook Endpoint

The plugin registers the following REST endpoint.

POST /wp-json/sms-webhook/v1/incoming HTTP/1.1

Expected request fields include:

  • EventType
  • CallerNumber

📥 Installation

  1. Copy the plugin folder into the WordPress plugins directory.
  2. Activate the plugin from the WordPress administration panel.
  3. Open the plugin settings page.
  4. Configure your API credentials.
  5. Configure your message templates.
  6. Save your settings.

⚙️ Configuration Notes

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.

📝 Logging

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/

🧠 Technical Notes

  • 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.

📷 Screenshots

📷 View Plugin Settings

Plugin Settings


📄 License

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.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages