> ## Documentation Index
> Fetch the complete documentation index at: https://withkazi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending and Tracking SMS in the Customer Portal

> Use the LaraCopilot portal to send outbound SMS messages via configured gateways and track delivery status for all messages in your account.

The LaraCopilot portal includes a built-in SMS workspace that lets you send outbound text messages through your account's active gateways and monitor delivery results in one place. Messages are dispatched in real time, and delivery status is updated automatically via DLR (delivery receipt) callbacks — so you always know whether a message reached its destination without leaving the portal.

## Navigating to the SMS page

Go to `/portal/sms` from the portal navigation. The page is split into two panels: a send form on the left for each active gateway, and your full SMS history on the right.

<Note>
  Only gateways that have been marked **Active** by your administrator appear in the send panel. If no gateways are shown, ask your admin to activate an SMS gateway for your account.
</Note>

## What the SMS page shows

**Active gateways panel (left)**

Each active gateway is displayed as a card with its name, status badge, and a send form. The `From Sender` field is pre-filled with the gateway's default sender ID configured by your admin, though you can override it.

**SMS history panel (right)**

The history table shows the 20 most recent outbound messages for your tenant, ordered by request time. Each row includes:

| Column        | Description                              |
| ------------- | ---------------------------------------- |
| **To**        | Recipient phone number (`to_number`)     |
| **Sender**    | Sender ID or number used (`from_sender`) |
| **Message**   | Text content of the message              |
| **Status**    | Current delivery status                  |
| **Requested** | Timestamp when the message was submitted |

## Sending an SMS

<Steps>
  <Step title="Open the SMS workspace">
    Navigate to `/portal/sms`. The active gateway cards appear on the left side of the page.
  </Step>

  <Step title="Fill in the recipient">
    Enter the destination phone number in the **To Number** field. Maximum 30 characters.
  </Step>

  <Step title="Set the sender ID">
    The **From Sender** field is pre-filled with the gateway's default sender ID. Edit it if you need to use a different sender name or number. Maximum 30 characters.
  </Step>

  <Step title="Write your message">
    Type your message text in the **Message** field. Maximum 1,000 characters.
  </Step>

  <Step title="Send">
    Click **Send via \[GATEWAY]**. The portal submits the message to the gateway immediately. You are redirected back to `/portal/sms` and the new message appears in the history table with an initial status.
  </Step>
</Steps>

<Tip>
  If you have multiple active gateways, a separate send form card appears for each one. Use the gateway name on each card to choose the right one for your destination.
</Tip>

## Message statuses

Every message in the history table carries one of four delivery statuses:

<Tabs>
  <Tab title="Queued">
    The message record has been created in LaraCopilot but the send request to the gateway has not yet been attempted. This status is set immediately on form submission before the HTTP call is made.
  </Tab>

  <Tab title="Submitted">
    The gateway accepted the message and returned a successful response. The portal stores the gateway's `message_id` for DLR correlation. The message is now in the carrier network.
  </Tab>

  <Tab title="Delivered">
    A DLR callback was received from the SMS gateway confirming the message was delivered to the handset. This is the final successful state.
  </Tab>

  <Tab title="Failed">
    Either the gateway returned an error response, the connection timed out (15-second limit), or an exception occurred during sending. The error detail is recorded internally. Check with your admin if messages are consistently failing.
  </Tab>
</Tabs>

## Delivery tracking

When a message is sent, LaraCopilot registers a DLR callback URL with the gateway. When the carrier network reports final delivery (or failure), the Jasmin gateway POSTs back to that URL and the portal updates the message's `delivery_status` from `submitted` to `delivered` (or `failed`). This happens automatically — you only need to refresh the SMS history page to see the latest status.

<Note>
  DLR updates depend on the carrier network and the gateway's DLR reporting capability. If a message stays in `Submitted` status for an extended period, the carrier may not have sent a delivery receipt. Contact your administrator if you need to investigate.
</Note>
