Back to Blog List
HomeBlogHow to Set Up Automated SMS Notifications for WooCommerce & Shopify in Sri Lanka (2026 Guide)
E-CommerceDevelopersWooCommerce

How to Set Up Automated SMS Notifications for WooCommerce & Shopify in Sri Lanka (2026 Guide)

SMSGo Team August 24, 2026 6 min read
How to Set Up Automated SMS Notifications for WooCommerce & Shopify in Sri Lanka (2026 Guide)

In Sri Lanka’s rapidly expanding e-commerce market, communication speed directly dictates your delivery success rate. Over 75% of online purchases in the country rely on Cash on Delivery (COD), which makes instant customer contact essential to avoiding bogus orders, package rejections, and expensive courier return fees.

While emails often get lost in spam folders or ignored (averaging an 18% open rate in Sri Lanka), SMS messages boast a staggering 98% open rate within 3 minutes of dispatch. In this complete guide, we will walk you through setting up automated SMS notifications and COD order verification for both WooCommerce and Shopify stores using the SMSGo.lk SMS Gateway API.

Why Automated SMS Alerts Are Essential for Sri Lankan Online Stores

Running an online retail store without real-time SMS alerts creates operational blind spots. Here is how automating SMS transforms your business:

  • Reduces COD Return to Origin (RTO) by up to 45%: Sending an immediate order confirmation SMS with an OTP or cancellation link prevents impulse buyers from denying orders upon courier delivery.
  • Fewer "Where Is My Order?" (WISMO) Support Tickets: Proactive SMS updates with tracking links keep customers informed, freeing your customer support team to focus on sales.
  • Higher Brand Trust: Messages sent with your official TRCSL-registered brand sender mask (e.g. YOURSTORE) assure customers that your store is authentic and professional.

The 4 Essential SMS Automation Flows

Every successful e-commerce store in Sri Lanka should configure the following automated triggers:

1. Instant Order Confirmation & COD Verification

Triggered immediately when a customer hits "Place Order". For COD orders, include an automated OTP verification step to confirm their mobile number before dispatching the parcel.

Hi [Customer_Name], thank you for your order #[Order_ID] at [Store_Name]! Total: LKR [Amount]. We will dispatch your package shortly. Track here: [Short_URL]

2. Parcel Dispatch & Courier Tracking

Triggered when the order status changes to "Shipped" or "Dispatched". Include the courier partner's name (e.g., Prompt Xpress, Domex, Pronto, Courier.lk, Koombiyo) and tracking number.

Good news! Your order #[Order_ID] has been handed over to [Courier_Name] (Waybill: [Tracking_No]). Delivery expected within 1-2 business days.

3. Out for Delivery Alert

Sent on the morning of delivery to remind customers to keep the exact cash ready for COD orders, drastically speeding up courier handovers.

Your [Store_Name] parcel #[Order_ID] is out for delivery today! Please keep LKR [Amount] in cash ready for the courier. Support: 0771234567

4. Abandoned Cart Recovery

Triggered 30 to 60 minutes after an abandoned checkout with an exclusive limited-time incentive or discount code.

Hi [Name], you left items in your cart at [Store_Name]! Complete your order within 2 hours and get 5% OFF with code SAVE5: [Cart_URL]

Integrating SMS with WooCommerce (WordPress)

Integrating SMSGo with your WordPress WooCommerce store can be done in two simple ways:

Method A: Using WooCommerce Action Hooks (PHP)

Add the following code snippet to your theme's functions.php or via a custom code snippets plugin:

<?php
add_action('woocommerce_order_status_processing', 'smsgo_send_order_sms', 10, 1);

function smsgo_send_order_sms($order_id) {
    $order = wc_get_order($order_id);
    $phone = $order->get_billing_phone();
    $first_name = $order->get_billing_first_name();
    $total = $order->get_total();

    // Format phone number to international standard (947XXXXXXXX)
    $phone = preg_replace('/[^0-9]/', '', $phone);
    if (substr($phone, 0, 1) === '0') {
        $phone = '94' . substr($phone, 1);
    }

    $message = "Hi {$first_name}, your order #{$order_id} (LKR {$total}) is confirmed! Thank you for shopping with us.";

    $response = wp_remote_post('https://api.smsgo.lk/api/v1/sms/send', [
        'headers' => [
            'Content-Type' => 'application/json',
            'X-API-Key'    => 'YOUR_SMSGO_API_KEY',
        ],
        'body' => json_encode([
            'to'           => $phone,
            'message'      => $message,
            'mask'         => 'YOURMASK',
            'campaignName' => 'WooCommerce-Order'
        ]),
        'timeout' => 15,
    ]);
}
?>

Integrating SMS with Shopify

Shopify stores can leverage Shopify Webhooks connected to an API endpoint or automation tool (such as Make.com, Zapier, or a serverless Cloudflare Worker):

  1. Go to Shopify Admin > Settings > Notifications > Webhooks.
  2. Create a webhook for the event Order creation or Order fulfillment.
  3. Point the webhook URL to your serverless handler which forwards the payload to the SMSGo REST API.
// Example Node.js serverless webhook handler
export async function handleShopifyWebhook(req, res) {
  const order = req.body;
  const rawPhone = order.billing_address?.phone || order.customer?.phone;
  if (!rawPhone) return res.status(200).send('No phone');

  // Format to Sri Lanka standard (947XXXXXXXX)
  const phone = rawPhone.replace(/\D/g, '').replace(/^0/, '94');

  await fetch('https://api.smsgo.lk/api/v1/sms/send', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': process.env.SMSGO_API_KEY
    },
    body: JSON.stringify({
      to: phone,
      message: `Hi ${order.customer.first_name}, order #${order.order_number} confirmed! Total: LKR ${order.total_price}. We will update you when dispatched.`,
      mask: process.env.SMSGO_MASK,
      campaignName: 'Shopify-Order'
    })
  });

  return res.status(200).json({ success: true });
}

Key Best Practices for Sri Lankan Stores

  • Character Limits: Keep English notifications strictly under 160 characters to consume only 1 SMS credit per alert.
  • Local Language Alerts: If your customer base prefers Sinhala or Tamil, keep Unicode messages under 70 characters.
  • Timing: Deliver non-urgent alerts (like review requests or abandoned carts) between 8:00 AM and 8:00 PM to comply with local TRCSL guidelines.

Conclusion

Setting up automated SMS notifications for your WooCommerce or Shopify store takes less than 15 minutes and pays for itself immediately by slashing canceled deliveries and elevating your customer experience. Explore our low-cost SMS pricing packages and start testing your integration in the sandbox today with SMSGo.lk.

Implement this in your platform today

Integrate SMSGo's high-speed Sri Lankan SMS gateway API, set up secure OTP verification, or start bulk marketing campaigns.

Related Articles