Osy#betaRun it on Osyrin: osyrin.com

Kits · Service desk

Conversations by text

Text messages as a channel for Osysharp.Conversations — replies through Osysharp.Sms's outbox from the app's own number, a text received continues that number's latest conversation within a window, carrier delivery reports, and a refusal of an alphanumeric sender that could never be answered.

Package
Osysharp.Conversations.Sms
Install
use Osysharp.Conversations.Sms@0;
Group
Service desk
Tests
7 in the kit’s own suite
Builds on
Identity, Text messages, Conversations

Text messages as a channel for Osysharp.Conversations. A reply the desk writes on a conversation the customer started by text goes out through Osysharp.Sms's outbox — from the app's own number, the one the customer texted — and a text received becomes a message from that number, continuing the number's latest conversation if it moved within the window (seven days by default), or starting a new one. A carrier's delivery report moves the delivery it reports on. A reply too long for one text is refused when it is written.

Use it

osy

// app.osy
use Osysharp.Identity@0;
use Osysharp.Sms@0;
use Osysharp.Sms.Elks@0;              // or another carrier's sender
use Osysharp.Conversations@0;
// Osysharp.Conversations.Sms is not written: it arrives by itself, because the app uses what it completes (`osy lock` says so)
use Osysharp.Workflow;
use Osysharp.Ui;

osy

using Osysharp.Sms;
using Osysharp.Conversations;
using Osysharp.Conversations.Sms;

app.Sms = new SmsSetup { Sender = new ElksSmsSender { Username = …, Password = … } };
app.Conversations = new ConversationsSetup { Channels = [new SmsConversationChannel { Number = "+46766861004" }] };

// The carrier's inbound webhook and delivery report, until the platform's signed receivers land:
//   ReceiveSms(from, to, message, id);  SmsDeliveryReport(id, delivered, problem);

What it will not do

Text from a NAME. app.Sms.From = "Acme" is right for a one-time code; a conversation needs a number to be answered on, so the channel is not ready until it has one — and says so.

Source and tests

model/SmsChannel.osy; tests/sms.test.osy asserts what the carrier was handed, with a recording sender — no test texts anybody.

Get it

Add the kit to your app’s manifest:

osy

app MyApp {
  use Osysharp.Conversations.Sms@0;
}

Then run osy lock: it downloads the release, verifies it by its content address and pins that version in osyrin.lock. osy kits Osysharp.Conversations.Sms shows what the kit is for, from inside your app.

Reference: osy docs ui-conversations-kit.