Gennet SMS for WordPress & WooCommerce
gennet-wordpress-sms
by Gennet · github.com/engrmukul/gennet-wordpress-sms · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/engrmukul/gennet-wordpress-sms/archive/refs/heads/main.zipReadme
Gennet SMS for WordPress & WooCommerce
Standalone WordPress plugin for sending transactional SMS through the Gennet SMS API
(https://isms.gennet.com.bd). No Composer, Laravel, or Guzzle dependency — all HTTP
calls use the native WordPress HTTP API (wp_remote_request()).
Features
- Manual SMS sending (Gennet SMS > Send SMS).
- WooCommerce order-status SMS notifications, with per-event templates and sender ID overrides, and duplicate-send prevention.
- SMS activity log with masked recipient numbers.
- API token via database setting or
wp-config.phpconstant. - Developer hooks and a
gennet_sms()service accessor.
Installation
- Upload via Plugins > Add New > Upload Plugin, or extract into
wp-content/plugins/gennet-sms. - Activate.
- Configure under Gennet SMS > Settings.
Configuration
API token
Preferred (production): define in wp-config.php:
define( 'GENNET_SMS_API_TOKEN', 'your-token-here' );
When this constant is defined, it always takes precedence over the database-stored token,
and the Settings screen will indicate the token is managed via wp-config.php.
Alternatively, enter the token directly in Gennet SMS > Settings. It is stored as a plugin option and is never re-displayed in full once saved.
Sender ID
Set a default Sender ID in Settings. WooCommerce order events can override it individually.
WooCommerce setup
Enable Gennet SMS > WooCommerce, then toggle which order statuses (New, Pending, Processing, On hold, Completed, Cancelled, Refunded, Failed) trigger a customer SMS.
Notification templates
Edit per-event message text under Gennet SMS > Templates. Supported placeholders:
{customer_name} {first_name} {last_name} {order_id} {order_number}
{order_status} {order_total} {currency} {site_name} {billing_phone}
Unknown placeholders are left unchanged. No PHP is ever evaluated in a template.
Manual SMS
Gennet SMS > Send SMS lets an authorized admin send a one-off SMS with local validation and an estimated (non-authoritative) segment count.
Logs
Gennet SMS > Logs shows recent send attempts. Recipient numbers are masked
(e.g. 88017*****678) and only a truncated message preview is stored — never the API
token, and never the full message body.
Developer API
$response = gennet_sms()->send( '8801712345678', 'Hello from WordPress' );
Or via the plugin container:
Gennet\WordPressSms\Plugin::instance()->sms()->send( $msisdn, $message );
Hooks
Actions:
gennet_sms_before_send( $msisdn, $message, $context )gennet_sms_sent( $response, $context )gennet_sms_failed( $exception, $context )
Filters:
gennet_sms_sender_idgennet_sms_recipientgennet_sms_messagegennet_sms_request_payloadgennet_sms_template_variablesgennet_sms_template_valuegennet_sms_normalized_msisdn
None of these hooks ever receive the API token.
Security
- Every settings write requires
manage_options(ormanage_woocommerce), a nonce, and passes through sanitization/validation before being saved. - The API token is never logged, never echoed into page source beyond a masked hint, and never sent to JavaScript.
- Automatic retries are never performed for SMS sends — a retry after a transport failure could duplicate a message that already reached the carrier.
- No inbound webhook/DLR listener is registered; the Gennet webhook signing contract has not yet been confirmed.
Troubleshooting
- "API token is not configured": set
GENNET_SMS_API_TOKENinwp-config.php, or enter a token in Settings. - No SMS sent on order status change: confirm the event is enabled under Gennet SMS > WooCommerce, and that the order has a billing phone number.
- Same event sent only once even after re-saving order: this is intentional — duplicate-send prevention is tracked per order/event via order meta.
Known limitations (v1.0.0)
Only POST /api/v3/sms-send is confirmed against the production Gennet API. Bulk SMS,
dynamic SMS, delivery status/DLR, balance, and incoming SMS are not implemented in this
release, pending confirmation of their endpoints and contracts.