Customer Notifications
Transactional notifications — order confirmations, shipping updates, appointment reminders, delivery alerts — are the highest-value messages you send. They are expected, opened almost universally, and directly reduce support load. This guide shows how to implement reliable customer notifications across Africa with AfriRoute.
Scenario: E-Commerce Order Lifecycle
A Nairobi-based online store wants to keep buyers informed at every step: order placed, payment received, shipped, and out for delivery. Each event triggers an SMS, with a fallback to WhatsApp for richer updates.
Why Notifications Matter
- 97%+ open rate for transactional SMS, usually within minutes
- Fewer "where is my order?" tickets — customers are informed proactively
- Higher trust — a registered sender ID shows your brand, not a random number
Step 1: Send on Each Order Event
Wire a notification into each state transition in your order system:
async function notifyOrderEvent(order, event) {
const templates = {
placed: `Hi ${order.name}, order #${order.id} received. We'll text you when it ships.`,
paid: `Payment of ${order.total} ${order.currency} confirmed for order #${order.id}. Thank you!`,
shipped: `Order #${order.id} has shipped via ${order.carrier}. Track: ${order.tracking_url}`,
delivery: `Your order #${order.id} is out for delivery today. Please keep your phone nearby.`
};
await fetch('https://api.afriroute.ai/api/v1/sms/send', {
method: 'POST',
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
to: order.phone, // E.164, e.g. +254712345678
from: 'DukaShop', // registered transactional sender ID
message: templates[event],
category: 'transactional',
callback_url: 'https://dukashop.co.ke/webhooks/sms'
})
});
}
Step 2: Track Delivery via Webhook
Update your order record when the carrier confirms delivery, so you know the customer was actually reached:
app.post('/webhooks/sms', express.json(), async (req, res) => {
const { message_id, status, to, delivered_at } = req.body;
await db.notifications.update({ message_id }, { status, delivered_at });
if (status === 'failed') {
await enqueueWhatsAppFallback(to, message_id); // try a second channel
}
res.sendStatus(200);
});
Step 3: Channel Fallback
If SMS fails (e.g. handset off for 48h), retry the same content over WhatsApp:
def whatsapp_fallback(phone, text):
requests.post('https://api.afriroute.ai/api/v1/whatsapp/send',
headers={'Authorization': 'Bearer $AFRIROUTE_API_KEY'},
json={'to': phone, 'template': 'order_update', 'parameters': [text]})
Compliance Notes
- Transactional notifications generally do not require marketing opt-in, but you must still respect data protection law — see Data Protection.
- Use a registered transactional sender ID per country for best delivery — see Sender ID Registration.
- Keep each message under 160 GSM-7 characters to stay at one segment — see SMS Pricing.
Best Practices
- Send promptly — notifications lose value if they lag the event.
- Include the order reference so support can act on a reply.
- Localize — send in the customer's preferred language.
- Don't over-notify — group related events where sensible.
- Log delivery status for every message to measure reachability.
Related
Last Updated: May 2026