WhatsApp COD confirmation, order by order
When a customer checks out with cash on delivery, the order waits in "Awaiting confirmation" (stock is held) while the customer receives, from your WhatsApp number, a message with two buttons. A "WhatsApp" column in the order list tracks each step.
- Confirm → the order moves to Processing, with a WhatsApp thank-you and no duplicate SMS
- Cancel → the order is flagged for you, or cancelled with stock returned if you chose automatic cancellation
- No reply after N hours → one reminder; still nothing → "No reply — call them", with an optional SMS to the customer
- WhatsApp refused the send (number not connected, template not approved…) → "WhatsApp failed", with an optional SMS
A reply cannot be forged
Enabling COD registers your site with EnvoiSMS (POST /v1/webhooks, event message.inbound) and stores the signing secret it returns. Each customer reply reaches /wp-json/envoisms/v1/webhook signed with HMAC-SHA256 in the X-EnvoiSMS-Signature-256 header; a bad signature, or one older than 5 minutes, is refused.
- A reply is accepted only from the order's own billing number
- Each button carries a tag derived from the order key, so a payload cannot target another order
- A second tap, or a webhook retry, never changes an order already confirmed or cancelled
Order status SMS
Two messages, each editable: when the order moves to Processing and when it is Completed. Leave one empty to send nothing.
- Variables: {first_name}, {last_name}, {order_id}, {order_total}, {billing_city}
- Your branded Sender ID (the sender name you registered)
- Numbers normalised to E.164 from the billing country (06…, +212…, 00212…)
- Every send carries an Idempotency-Key, so a status hook that fires twice sends one message
Requirements
For COD confirmation: your WhatsApp number connected in your EnvoiSMS.ma dashboard (with coexistence you keep using the WhatsApp Business app on your phone), the confirmation template approved, and your site reachable over public HTTPS. Order SMS need only your API key.
- WooCommerce 7.1+ and PHP 8.0+
- Compatible with High-Performance Order Storage (HPOS)
- The template is created from the plugin settings ("Create the WhatsApp templates" button, French and Arabic); EnvoiSMS reviews it and submits it to Meta, and its status shows on the same page
Install in five steps
The plugin installs like any WordPress plugin, then is configured from WooCommerce.
- Download the plugin zip from GitHub, or clone the repository into /wp-content/plugins/envoisms-woocommerce.
- Activate "EnvoiSMS for WooCommerce" under Plugins.
- Go to WooCommerce → EnvoiSMS Maroc.
- Enter your API key from the EnvoiSMS.ma dashboard and save.
- For COD confirmation: tick "Enable", save, then click "Create the WhatsApp templates".
- Source code: github.com/envoisms/envoisms-woocommerce
- MIT licence, no plugin subscription: you pay for the messages you send, in dirhams