Integrations
WordPress and WooCommerce
Send WooCommerce order updates, form notifications and password reset links by WhatsApp, SMS or Telegram, with the OmniMessage plugin or with WooCommerce’s own webhooks.
Two ways to connect a store#
| OmniMessage plugin | WooCommerce webhooks | |
|---|---|---|
| Install | A WordPress plugin | Nothing: WooCommerce’s built-in webhooks |
| Covers | WooCommerce orders, abandoned carts, checkout opt-in, user registration, password resets, Contact Form 7 and WPForms | WooCommerce orders and new customers |
| Messages are designed | In WordPress, or in the OmniMessage console | In the OmniMessage console |
| Set up with | An API key | A source created in the console |
The plugin#
The plugin omnimessage requires WordPress 6.8 or later and PHP 7.4 or later, and works with WooCommerce’s High-Performance Order Storage.
What it sends#
- WooCommerce: order placed, paid (Processing), on hold, completed, cancelled, refunded and failed payment; notes to the customer; an optional abandoned cart reminder with a link that restores the cart. An opt-in checkbox at checkout (classic and block checkout) and a Send message box on the order screen.
- WordPress: a message to you when a user registers, and password reset links sent to the phone number on the user profile.
- Forms: for Contact Form 7 and WPForms, a message to you for every submission and an optional confirmation to the sender.
Set it up#
- Install and activate the plugin.
- Create an API key in the console. Create integration key opens the dialog with the integration preset selected. Start with a test key (
om_test_): nothing is delivered and nothing is billed. - Open Settings › OmniMessage, paste the key, press Test connection, save, and pick a default channel. To keep the key out of the database, define it in
wp-config.phpinstead:define( 'OMNIMESSAGE_API_KEY', 'om_live_…' );. - Switch on the notifications you want on the WooCommerce, WordPress and Forms tabs.
- Send a test message from the Connection tab.
Messages are sent in the background through Action Scheduler (WP-Cron when WooCommerce is not active), so checkout never waits for the network. Failed sends are retried with backoff and every attempt is in the plugin’s log. Billing phone numbers are converted to international format with the order’s country; numbers that cannot be valid are skipped and logged.
Where the messages are designed#
- In WordPress (the default): each notification has a text with merge tags such as
{{customer.first_name}},{{order.number}}and{{order.tracking.url}}, or an approved WhatsApp template with its variables mapped to merge tags. The plugin renders the message and sends it withPOST /v1/messages. - In the OmniMessage console: choose "Manage templates in OmniMessage" in the plugin. The plugin registers the site as an integration source and from then on only reports events (
order.paid,cart.abandoned,form.submitted, …). Texts, templates, languages, delays and fallbacks are automations in the console, and the plugin links to the editor of each event. It sends only the events that have an automation switched on.
The merge-tag syntax is the same in both modes, so a template written in WordPress renders the same in the console. WhatsApp delivers free-form text only within 24 hours of the customer’s last message, so use an approved template for order notifications.
Consent#
By default only customers who tick the checkbox at checkout receive order messages. You can change this to send order updates to everyone who does not untick it. Abandoned cart reminders always need the ticked checkbox. Messaging rules differ by country and channel; you are responsible for following the ones that apply to you.
For developers#
| Hook | Kind | Purpose |
|---|---|---|
omnimessage_events | filter | Add or change notifications. |
omnimessage_event_payload | filter | Change the event before rendering or forwarding; return false to cancel. |
omnimessage_message_body | filter | Change the body of POST /v1/messages. |
omnimessage_wc_status_event | filter | Map custom order statuses to notifications. |
omnimessage_order_tracking | filter | Supply the tracking number, URL and carrier. |
omnimessage_allow_repeat | filter | Allow a notification to be sent again for the same order. |
omnimessage_message_sent, omnimessage_message_failed | action | After a send succeeded or finally failed. |
omnimessage_send_text( $to, $text, $channel = '' ) queues a text message, and omnimessage_dispatch( $key, $event, $context ) sends a notification you registered.
Known limits#
- Abandoned cart capture needs the classic checkout, or a signed-in customer who opted in earlier: the block checkout has no equivalent server-side hook.
- Delivery status (delivered, read, failed after acceptance) is not written back to the plugin’s log yet.
- A phone number from a country the plugin does not know is only accepted when it is typed with its calling code.
WooCommerce webhooks, without a plugin#
WooCommerce can sign webhooks itself, so a store can report its orders to OmniMessage with no plugin installed. Messages are then designed as automations in the console.
- In the console, open Integrations › WooCommerce, enter the store URL and create the source. Copy the signing secret: it is shown once.
- In WordPress, open WooCommerce › Settings › Advanced › Webhooks and add one webhook per topic: Order created, Order updated, Customer created. Status Active, API version WP REST API Integration v3, the delivery URL shown in the console, and the signing secret as Secret.
- Back in the console, add an automation per event, for example Order paid, and switch it on. Nothing is sent before that.
Order updates become order.paid (Processing), order.shipped (Completed), order.cancelled, order.refunded or order.status_changed; an update without a status change sends nothing. The customer comes from the billing address. The full mapping, the signature check and the answers are in Automation events › WooCommerce.