DEV Community

anusha
anusha

Posted on

I Built a Long SMS Demo That Keeps the Message Together

An appointment reminder looks simple until you write the complete version.

The time, address, check-in instructions, preparation checklist, accessibility details, and rescheduling instructions quickly become longer than one SMS segment. The obvious fallback is to send several separate texts. That works mechanically, but it makes the notification feel fragmented and gives the application several independent deliveries to reason about.

I built a small Node.js Telnyx example to explore the other option.

I recorded a short demo of the flow here: https://youtu.be/6R8UYNNKABI

The application sends one logical long message. Telnyx handles the carrier-level chunking, and the application keeps a parent record that can collect the statuses of the child message segments.

What the code does

The server is an Express application using the Telnyx Node.js SDK. Its main send path is intentionally small:

  • validate the destination number
  • require a message longer than 1,530 characters for the long-message demo
  • call the Telnyx Messages API once
  • store the returned parent message ID

The webhook path handles the delivery side. It verifies the signed request, reads the child message ID and parent message ID, and updates the delivery record.

That parent-child relationship is the part I would reuse in a real application. An appointment system, logistics platform, or incident-notification service can keep one workflow ID while still retaining the underlying messaging events.

The demo has two honest modes

The long-message mode demonstrates automatic chunking. The phone may render the resulting segments as one combined message, depending on the carrier and device.

The recording uses a separate sequence mode. It sends four medium-length appointment messages so each paragraph appears as a distinct, readable bubble. Those are four independent SMS sends, not one carrier-chunked message.

Keeping those modes separate makes the example easier to understand. One shows infrastructure behavior; the other shows a practical notification design that may be better for a human recipient.

Where I would use it

This pattern fits appointment reminders, delivery instructions, outage notices, customer-support updates, billing notifications, and field-service dispatches. The decision is simple: if the content is one indivisible notification, use the long-message path; if each update should stand on its own, send a sequence.

The complete code and API reference are in the Telnyx code examples repository.

Top comments (0)