WhatsApp & SMS

WordPress SMS Notifications: Text Alerts for Orders, Forms and Bookings

Email notifications from WordPress get buried. A text doesn't. Here's how to add WordPress SMS notifications for WooCommerce orders, contact forms and bookings, using a small plugin of your own and an SMS API.

WordPress SMS Notifications: Text Alerts for Orders, Forms and Bookings
On this page
  1. What's worth sending by SMS
  2. To customers
  3. To you and your team
  4. Plugin or code?
  5. Step 1: store the API key safely
  6. Step 2: a tiny plugin with a send function
  7. WooCommerce order texts
  8. Contact form alerts
  9. Booking reminders
  10. Keep the site fast
  11. Replies and opt-outs
  12. Writing the messages
  13. Checklist

A WordPress site sends a lot of email. New order. New form submission. Booking confirmed. Password reset. Most of those messages land among hundreds of others, and some go straight to spam. That's fine for receipts, but not for "a customer just asked for a quote and is comparing three suppliers this afternoon".

Texts get read, usually within minutes. Adding wordpress sms notifications for the moments that matter, both to your customers and to yourself, is one of the cheapest improvements you can make to a WordPress or WooCommerce site. Here's what to send and how to wire it up.

What's worth sending by SMS#

To customers#

  • Order confirmation, with the order number.
  • Shipped, out for delivery or ready for collection.
  • Booking confirmations and reminders the day before.
  • Delivery problems or stock issues that need a reply.

To you and your team#

  • New order, especially high-value or same-day orders.
  • New contact form or quote request.
  • New booking or cancellation.
  • Low stock on a best seller.

Keep marketing out of this list. Promotional texts need separate, explicit opt-in, and our guide to SMS marketing best practices covers how to do that properly.

Plugin or code?#

There are SMS plugins for WordPress, usually tied to one provider. If one fits your provider and needs, great. If not, a small custom plugin is easy to write and has some real advantages: it does exactly what you want, it doesn't add settings pages or upsells, and you can point it at any SMS API.

The examples below use the SMS Gora API, which sends from an Android phone and SIM you connect to your account, so customers see your own local number and can reply to it.

Step 1: store the API key safely#

Add the key to wp-config.php rather than the database or theme files:

define('SMSGORA_KEY', 'your-api-key');

Step 2: a tiny plugin with a send function#

Create wp-content/plugins/site-sms/site-sms.php:

<?php
/**
 * Plugin Name: Site SMS
 * Description: Sends SMS notifications through SMS Gora.
 */

function site_sms_send($to, $message) {
    if (!defined('SMSGORA_KEY') || !$to) return false;
    $res = wp_remote_post('https://tekservix.com/smsgora/api/v1/send-sms', [
        'timeout' => 15,
        'headers' => [
            'x-api-key'    => SMSGORA_KEY,
            'Content-Type' => 'application/json',
        ],
        'body' => wp_json_encode(['recipients' => (array) $to, 'message' => $message]),
    ]);
    if (is_wp_error($res) || wp_remote_retrieve_response_code($res) >= 400) {
        error_log('[site-sms] send failed: ' . (is_wp_error($res) ? $res->get_error_message() : wp_remote_retrieve_body($res)));
        return false;
    }
    return true;
}

Activate it under Plugins. Everything else hooks into this one function.

WooCommerce order texts#

WooCommerce fires an action whenever an order changes status. Send a text for the statuses customers care about:

add_action('woocommerce_order_status_changed', function ($order_id, $from, $to, $order) {
    $phone = $order->get_billing_phone();
    $name  = $order->get_billing_first_name();
    $num   = $order->get_order_number();
    $messages = [
        'processing' => "Hi $name, thanks for your order #$num. We'll text you when it ships.",
        'completed'  => "Good news $name: order #$num is on its way.",
    ];
    if (isset($messages[$to])) site_sms_send($phone, $messages[$to]);
}, 10, 4);

Phone numbers entered at checkout come in every format imaginable. Normalise them to international format (with the country code, like +44 or +1) before sending, using the billing country to add the code when it's missing.

And an alert to yourself for new orders:

add_action('woocommerce_new_order', function ($order_id) {
    $order = wc_get_order($order_id);
    site_sms_send('+447700900123', sprintf('New order #%s, %s, from %s',
        $order->get_order_number(), html_entity_decode(strip_tags(wc_price($order->get_total()))), $order->get_billing_first_name()));
});

Contact form alerts#

Most form plugins fire an action after a successful submission. With Contact Form 7, for example:

add_action('wpcf7_mail_sent', function ($form) {
    $sub = WPCF7_Submission::get_instance();
    if (!$sub) return;
    $d = $sub->get_posted_data();
    site_sms_send('+447700900123', sprintf('New enquiry from %s (%s): %s',
        $d['your-name'] ?? '?', $d['your-email'] ?? '', mb_substr($d['your-subject'] ?? '', 0, 60)));
});

WPForms (wpforms_process_complete) and Gravity Forms (gform_after_submission) have equivalent hooks. Keep the text short; it's a nudge to check your inbox, not a copy of the whole message. Speed matters here: the business that replies to an enquiry first often wins the job.

Booking reminders#

For booking plugins, send a reminder the day before using WP-Cron or, better, a real server cron job calling WordPress. A daily event might look like:

add_action('site_sms_daily', function () {
    foreach (my_get_tomorrows_bookings() as $b) {   // replace with your booking plugin's query
        site_sms_send($b['phone'], "Reminder: your appointment is tomorrow at {$b['time']}. Reply C to confirm or R to reschedule.");
    }
});
if (!wp_next_scheduled('site_sms_daily')) {
    wp_schedule_event(strtotime('tomorrow 16:00'), 'daily', 'site_sms_daily');
}

WP-Cron only runs when someone visits the site, so on quiet sites reminders can run late. Disable it in wp-config.php (define('DISABLE_WP_CRON', true)) and add a server cron that calls wp-cron.php every few minutes. Our guide to SMS appointment reminders has message wording that reduces no-shows.

Keep the site fast#

Each send is a web request. For a handful of messages that's fine, but if a checkout triggers several texts, or a slow API response could delay the order page, send them in the background. Action Scheduler, which ships with WooCommerce, is ideal: queue the send with as_enqueue_async_action and let it run a moment later, with retries if it fails.

Replies and opt-outs#

Because messages come from a real mobile number, customers will reply. With SMS Gora, replies land in the dashboard inbox and can be forwarded to your site by webhook, and STOP opt-outs are handled automatically. Make sure someone actually reads replies. A customer texting "can you deliver after 5?" expects an answer.

Writing the messages#

A text from a shop should read like a text, not like a cut-down email. A few habits help:

  • Start with your shop name if customers might not recognise the number: "Greenway: your order #1042 has shipped."
  • One message, one purpose. Don't add a discount code to a delivery update.
  • Stay under 160 characters where you can. Longer messages are split into parts, and emoji or some accented characters reduce the limit further. Our guide to the SMS character limit explains why.
  • Use a short tracking link rather than a long URL full of parameters.
  • Send at sensible hours. An order placed at midnight can get its "thanks" text then, but a review request can wait until mid-morning.

Test every message on a real phone before turning it on for all orders. Check that the name and order number fill in correctly, that the link works, and that the text makes sense with no context, because that's exactly how customers will see it.

Checklist#

  • API key in wp-config.php, not in the database or theme.
  • Only transactional messages for customers unless they've opted into marketing.
  • Phone numbers normalised to international format.
  • Failures logged, and sends queued if they could slow pages down.
  • Real cron for scheduled reminders.
  • Someone responsible for reading replies.

With a 40-line plugin you get texts that customers read and alerts you won't miss. SMS Gora plans start at $3.99 a month with unlimited SMS, and the API docs cover bulk sending, delivery status and webhooks if you want to go further.

Frequently asked questions

Can WordPress send SMS without a plugin?

WordPress itself doesn't send SMS, but you don't need a large plugin. A small custom plugin of 30 to 50 lines can hook into WordPress or WooCommerce events and call any SMS API with wp_remote_post.

Which WooCommerce events are worth texting customers about?

Order confirmed, order shipped or ready for collection, and delivery problems. Customers welcome those. Promotional texts need separate, explicit opt-in.

How do I get an SMS when someone fills in my contact form?

Most form plugins, such as Contact Form 7, WPForms and Gravity Forms, fire an action after a submission. Hook into it and send a short text to your own phone with the sender's name and a summary.

Share this article
Written by

The team behind Tekservix

The Tekservix Team builds and supports Tekservix: WhatsApp and SMS APIs, AI tools, invoicing, PDF and SEO tools for growing businesses. We write practical, tested guides based on what we see our customers do every day.

More articles from the Tekservix Team

Get new guides in your inbox

One short email when we publish something useful: WhatsApp and SMS marketing, AI tools, SEO and running a business online. No spam, unsubscribe anytime.