The Courier Team
August 17, 2023

When you need to send important alerts from your web or mobile app, text messages via SMS can be very useful, especially for time-sensitive notifications, e.g. to quickly warn users about things like possible fraud or payment issues. It can also be helpful to pair SMS notifications with other types of messages, such as email, Slack messages, or push notifications. This allows you to take a more layered approach to your notifications, adding notification logic that considers whether a user has read your earlier SMS attempts before deciding to notify them on these other channels.
While there are excellent SMS APIs like Twilio and MessageBird that let you send an SMS with a few lines of code, these services don't handle all the complexities of an automated SMS that will require an SMS notification system like Courier.
You will need to add extra logic around your notifications if you want to:
Without an SMS notification system to help you manage this work, you’ll be left developing and maintaining all this logic yourself.
This article shows how to use the Courier SMS notification system to easily send basic SMS notifications, as well as how to add automation logic around your notifications and read user preferences to avoid bombarding them with an excess of messages.
SMS notification systems provide a powerful set of features that extend far beyond SMS delivery. Here are some of the capabilities supported by Courier, which may be useful if you’re building a product requirements document (or developing against one) for product notifications.
In this example, we will use Courier, with Twilio as the SMS provider. We’ll build automated SMS notifications into a Node.js application. Although we are using Node.js, there are a number of quick start guides for other languages available.
Twilio offers a free trial with no credit card required, so we will use Twilio as our example SMS service provider. Start by signing up to Twilio. Once you have signed up, you will be directed to the Twilio console, where there is a basic tutorial for creating a new phone number for your Twilio messages. Once you have done this, continue with the tutorial and run the command to send yourself a test SMS, just to check that Twilio is working correctly.
Next, scroll down the Twilio console homepage to find your Twilio account SID, auth token, and phone number — which you will need to use Twilio with Courier.

Sign up to Courier and add Twilio as a channel, by selecting Twilio under configured providers. Now, enter your Twilio account SID, auth token, and phone number that you previously found in the Twilio console, and click the Save button.

We will be using an e-commerce package delivery notification for our example. Navigate to Designer → Create Template and name your template “Package delivery.” You will now be prompted to say which channel you want to use for sending your message. Select SMS and select Twilio as your SMS provider in the drop-down box.
Next, click on SMS under Channels to begin writing your notification for the SMS channel. Either use the AI-powered content generator or enter this text into the notification designer:
“Your package with reference {packageRef} is estimated for delivery between {startTimeHours}: {startTimeMins} and {endTimeHours}:{endTimeMins} today. Not going to be in? {rescheduleOrSafePlaceUrl}” and then click “Publish changes”.

Now you are going to write some code that will send an SMS notification to your phone from your Node.js code, using Courier (with Twilio as the SMS provider).
Inside your package-notification directory, create a file called package.js and add the following code:
Copied!
const { CourierClient } = require("@trycourier/courier");const courier = CourierClient({ authorizationToken: "<AUTH_TOKEN>" });const packageRef = "<PACKAGE_REFERENCE>";const startTimeHours = "<START_TIME_HOURS>";const startTimeMins = "<START_TIME_MINS>";const endTimeHours = "<END_TIME_HOURS>";const endTimeMins = "<END_TIME_MINS>";const rescheduleOrSafePlaceUrl = "<RESCHEDULE_OR_SAFE_PLACE_URL>";const { requestId } = courier.send({message: {to: {data: {packageRef : packageRef,startTimeHours : startTimeHours,startTimeMins : startTimeMins,endTimeHours : endTimeHours,endTimeMins : endTimeMins,rescheduleOrSafePlaceUrl : rescheduleOrSafePlaceUrl},phone_number: "<PHONE_NUMBER>",},template: "<NOTIFICATION_TEMPLATE_ID>",routing: {method: "single",channels: ["sms"],},},});
packageRef with your own values. Note: the time-based variables such as startTimeHours should each contain two digits, as they use military time.<AUTH_TOKEN> with your Courier API key.<PHONE_NUMBER> with your own phone number, so you can test that the SMS sends correctly.<NOTIFICATION_TEMPLATE_ID> with the ID of the template you just created. This can be found by going to your template in the Courier app and navigating to the notification settings:
When you run your code, it will send an SMS:

As you can see, it’s pretty simple to send an SMS using Courier. It's worth noting that Courier offers multiple notification channels — so you can use the same notification platform for communicating via email, Slack, MS Teams, push notifications, and more. For example, the user may have wanted this parcel notification as both a mobile push notification and an SMS.
Courier automations allows you to abstract complex SMS (or multi-channel) notification workflows into a no-code designer in the Courier web UI, which can then be invoked via Courier’s Automations API. Workflows are easily created as templates via drag-and-drop components. These templates contain all the logic needed for a notification sequence. It consists of a trigger and a number of actions. Once you’ve created the template, you can later run an automation from it.
Some examples of automation templates that can be created in the automation designer include:
In this tutorial, we will create an automation template that causes an order confirmation SMS to be sent when an “order completed” event occurs in Segment, the Customer Data Platform from Twilio. We will use Courier’s Segment integration to achieve this.
Navigate to Designer and click Create Template. Name your template “Order confirmation.” Select SMS as the notification channel and choose Twilio as a provider from the drop-down box.
Now, click the SMS channel on the left to add your message content to your template. Add the following text to the notification designer, then click Publish changes.
“Your recent order of {productName} (#{orderNumber}) has been completed. We hope you enjoyed your purchase and thank you for shopping with us.”
Navigate to the automations designer and click New Automation. Rename your automation from “Untitled Automation” to “Order Confirmation.”

Start with a trigger for your automation. For this example, we will choose a Segment event as the trigger. Drag the Segment trigger onto the automation designer canvas. You will need to select a particular Segment event within this. In this example, we will use an e-commerce Segment event called “order completed.”
Next, add a Send action to your automation and fill in the following information in this node:
refs.data.user_id as the user.
To use Segment dynamic data in the variables of your notification template, click on Advanced in the Send node, and enter the following in the data field:
{
"productName": "data.products.name"
---

Finally, click Publish changes.
When an order gets marked as completed in Segment, this will invoke the automation, and cause your SMS to be sent. You can also test your automation template by invoking it yourself: click the Invoke button at the top of your automation template to find a cURL command that you can run to check your automation is working properly.
We have covered why you need an SMS notification system and how to automatically trigger an SMS using Courier with Twilio.
You can get started immediately using Courier’s free tier and Twilio’s free trial. Courier allows you to integrate with many of the big SMS notification providers, which means that you don’t have to decide right away which provider to use. If you’ve been working along with this coding example and have decided you want to use Courier to send more notifications, you can sign up today or contact us to discuss your specific use case.

Transactional, Product, and Marketing Notifications: What Are the Differences?
Understanding the difference between transactional, product, and marketing notifications is essential for developers building notification infrastructure. Transactional notifications confirm user actions and require no opt-in. Product notifications drive feature adoption through education. Marketing notifications promote sales and require explicit consent. This guide explains the legal requirements, best practices, and when to use each notification type to build compliant systems users trust.Retry
By Kyle Seyler
October 23, 2025

How to Add Toast Notifications with the New Courier Toasts SDK
Learn how to add real-time, customizable toast notifications to your app with the Courier Toasts SDK. This quick tutorial shows how to integrate toasts using Web Components or React and sync them with your notification center for a seamless, modern UX.
By Dana Silver
October 20, 2025

What is the Twilio Messaging API?
Twilio's Messaging API enables developers to send and receive SMS, MMS, WhatsApp, and RCS messages at scale across 180+ countries. While Twilio excels at reliable message delivery through carrier networks, modern applications need more than single-channel messaging. Courier acts as a provider-agnostic orchestration layer that activates messaging across Twilio and other channels from a single platform. You get intelligent routing, user preference management, and fallback logic without vendor lock-in.
By Kyle Seyler
October 03, 2025
© 2026 Courier. All rights reserved.