Skip to content
Skills Library
Sales & customer service · Tool integration

orchardcore-sms

/orchardcore-sms

Skill for configuring SMS messaging in Orchard Core. Covers SMS provider setup (Log, Twilio, Azure Communication Services), SmsSettings and TwilioSettings recipes, ISmsService and SmsMessage for programmatic sending including the From number, custom ISmsProvider implementation, SmsProviderOptions and TwilioOptions read through IOptionsMonitor, the SMS Task workflow activity with its From Phone Number option, SMS notifications, the Twilio health check, and SmsPermissions. Use this skill when requests mention Orchard Core SMS, Configure and Send SMS Messages, Available SMS Providers, Enabling SM

Licence
MIT
Last repository change
21.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 21.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Skill for configuring SMS messaging in Orchard Core. Covers SMS provider setup (Log, Twilio, Azure Communication Services), SmsSettings and TwilioSettings recipes, ISmsService and SmsMessage for programmatic sending including the From number, custom ISmsProvider implementation, SmsProviderOptions and TwilioOptions read through IOptionsMonitor, the SMS Task workflow activity with its From Phone Number option, SMS notifications, the Twilio health check, and SmsPermissions. Use this skill when requests mention Orchard Core SMS, Configure and Send SMS Messages, Available SMS Providers, Enabling SM

Original author description

Skill for configuring SMS messaging in Orchard Core. Covers SMS provider setup (Log, Twilio, Azure Communication Services), SmsSettings and TwilioSettings recipes, ISmsService and SmsMessage for programmatic sending including the From number, custom ISmsProvider implementation, SmsProviderOptions and TwilioOptions read through IOptionsMonitor, the SMS Task workflow activity with its From Phone Number option, SMS notifications, the Twilio health check, and SmsPermissions. Use this skill when requests mention Orchard Core SMS, Configure and Send SMS Messages, Available SMS Providers, Enabling SM

How it works

  1. Guidelines
  2. Available SMS Providers
  3. Enable and Configure Twilio
  4. Sending SMS Programmatically
  5. Creating a Custom SMS Provider (Simple)
  6. Creating a Custom SMS Provider (Settings-backed)
  7. Workflow SMS Activity
  8. SMS Notifications
  9. Health Checks
  10. Upgrading from 3.x
Original SKILL.md headings · 293 lines, 859 words
SKILL.md preview
---
name: orchardcore-sms
description: Skill for configuring SMS messaging in Orchard Core. Covers SMS provider setup (Log, Twilio, Azure Communication Services), SmsSettings and TwilioSettings recipes, ISmsService and SmsMessage for programmatic sending including the From number, custom ISmsProvider implementation, SmsProviderOptions and TwilioOptions read through IOptionsMonitor, the SMS Task workflow activity with its From Phone Number option, SMS notifications, the Twilio health check, and SmsPermissions. Use this skill when requests mention Orchard Core SMS, Configure and Send SMS Messages, Available SMS Providers, Enabling SMS Features, Configuring Twilio, Configuring Azure Communication Services via Admin UI, custom SMS provider, AddSmsProvider, AddSmsProviderOptionsConfiguration, upgrading SMS code to Orchard Core 4, or closely related Orchard Core implementation, setup, extension, or troubleshooting work. Strong matches include OrchardCore.Sms, OrchardCore.Sms.Azure, and OrchardCore.Notifications.Sms.
license: Apache-2.0
metadata:
  author: CrestApps Team
  version: "1.0"
---

# Orchard Core SMS

## Guidelines

- Enable `OrchardCore.Sms` to get **Settings → Communication → SMS**, guarded by
  `OrchardCore.Sms.SmsPermissions.ManageSmsSettings`.
- Configure and select a default provider before sending; until then
  `ISmsService` returns a failed `Result`.
- Use `ISmsService` to send; implement `ISmsProvider` for new providers.
- `SmsProviderOptions`, `TwilioOptions`, and `AzureSmsOptions` are refreshed from
  site settings without a shell release; read them with
  `IOptionsMonitor<T>.CurrentValue`.
- All recipe JSON must be wrapped in `{ "steps": [...] }`.
- All C# classes must use the `sealed` modifier, except for View Models.

## Available SMS Providers

| Provider | Feature | Description |
|----------|---------|-------------|
| `Log` | `OrchardCore.Sms` | Writes messages to the log. Registered only when the host environment is `Development`. |
| `Twilio` | `OrchardCore.Sms` | Sends through Twilio. Requires an account SID, auth token, and phone number. |
| `Azure` | `OrchardCore.Sms.Azure` | Tenant-specific Azure Communication Services settings. |
| `DefaultAzure` | `OrchardCore.Sms.Azure` | Azure Communication Services from `OrchardCore:Sms:Azure` configuration. |

See `orchardcore-sms-azure` for the Azure providers.

## Enable and Configure Twilio

```json
{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "OrchardCore.Sms"
      ]
    },
    {
      "name": "Settings",
      "SmsSettings": {
        "DefaultProviderName": "Twilio"
      },
      "TwilioSettings": {
        "IsEnabled": true,
        "PhoneNumber": "+15555550123",
        "AccountSID": "your-account-sid"
      }
    }
  ]
}
```

The admin UI (**Twilio** tab) encrypts `AuthToken` with Data Protection, so
enter the token there instead of in a recipe. Then pick the default on the
**Providers** tab.

## Sending SMS Programmatically

```csharp
using Microsoft.AspNetCore.Mvc;
using OrchardCore.Sms;

public sealed class NotificationController : Controller
{
    private readonly ISmsService _smsService;

    public NotificationController(ISmsService smsService)
    {
        _smsService = smsService;
    }

    [HttpPost]
    public async Task<IActionResult> SendOrderConfirmation(
        string phoneNumber,
        string orderId,
        CancellationToken cancellationToken)
    {
        var message = new SmsMessage
        {
            To = phoneNumber,
            Body = $"Your order {orderId} has been confirmed and is being processed.",
        };

        var result = await _smsService.SendAsync(message, cancellationToken);

        if (result.Succeeded)
        {
            return Ok(new { success = true });
        }

        return BadRequest(new { success = false, errors = result.Errors });
    }
}
```

`SmsMessage` has `To`, `Body`, and an optional `From`; when `From` is empty the
provider's configured phone number is used. The
`SendAsync(to, body, cancellationToken)` extension builds the message for
simple cases. Use E.164 numbers such as `+15555550123`.

## Creating a Custom SMS Provider (Simple)

`ISmsProvider` requires a `Name` and `SendAsync`. Register providers that need
no settings with `AddSmsProvider<T>("TechnicalName")`:

```csharp
using System.Net.Http.Json;
using Microsoft.Extensions.Localization;
using OrchardCore.Infrastructure;
using OrchardCore.Sms;

public sealed class WebhookSmsProvider : ISmsProvider
{
    public const string TechnicalName = "Webhook";

    private readonly IHttpClientFactory _httpClientFactory;

    internal readonly IStringLocalizer S;

    public WebhookSmsProvider(
        IHttpClientFactory httpClientFactory,
        IStringLocalizer<WebhookSmsProvider> stringLocalizer)
    {
        _httpClientFactory = httpClientFactory;
        S = stringLocalizer;
    }

    public LocalizedString Name => S["Webhook"];

    public async Task<Result> SendAsync(
        SmsMessage message,
        CancellationToken cancellationToken = default)
    {
        var client = _httpClientFactory.CreateClient(TechnicalName);

        var response = await client.PostAsJsonAsync(
            "/api/sms/send",
            new { from = message.From, to = message.To, body = message.Body },
            cancellationToken);

        return response.IsSuccessStatusCode
            ? Result.Success()
            : Result.Failed(S["Failed to send SMS via webhook."]);
    }
}
```

```csharp
using OrchardCore.Sms;

public sealed class Startup : StartupBase
{
    public override void ConfigureServices(IServiceCollection services)
    {
        services.AddHttpClient(WebhookSmsProvider.TechnicalName, client =>
            client.BaseAddress = new Uri("https://sms.example.com"));

        services.AddSmsProvider<WebhookSmsProvider>(WebhookSmsProvider.TechnicalName);
    }
}
```

## Creating a Custom SMS Provider (Settings-backed)

When availability depends on site settings, build options from the settings,
read them through `IOptionsMonitor<T>`, and contribute the provider with
`IConfigureOptions<SmsProviderOptions>`. This mirrors the built-in Twilio
provider.

```csharp
using Microsoft.Extensions.Options;
using OrchardCore.Settings;
using OrchardCore.Sms;

public sealed class CustomSmsSettings
{
    public bool IsEnabled { get; set; }
}

public sealed class CustomSmsOptions
{
    public bool IsEnabled { get; set; }
}

public sealed class CustomSmsOptionsConfiguration : IConfigureOptions<CustomSmsOptions>
{
    private readonly ISiteService _siteService;

    public CustomSmsOptionsConfiguration(ISiteService siteService)
    {
        _siteService = siteService;
    }

    public void Configure(CustomSmsOptions options)
        => options.IsEnabled = _siteService.GetSettings<CustomSmsSettings>().IsEnabled;
}

public sealed class CustomProviderOptionsConfiguration : IConfigureOptions<SmsProviderOptions>
{
    private readonly IOptionsMonitor<CustomSmsOptions> _customOptions;

    public CustomProviderOptionsConfiguration(IOptionsMonitor<CustomSmsOptions> customOptions)
    {
        _customOptions = customOptions;
    }

    public void Configure(SmsProviderOptions options)
    {
        options.TryAddProvider("CustomProvider", new SmsProviderTypeOptions(typeof(CustomSmsProvider))
        {
            IsEnabled = _customOptions.CurrentValue.IsEnabled,
        });
    }
}

public sealed class Startup : StartupBase
{
    public override void ConfigureServices(IServiceCollection services)
    {
        services
            .AddSignalOptionsChangeTokenSource<CustomSmsOptions>()
            .AddTransient<IConfigureOptions<CustomSmsOptions>, CustomSmsOptionsConfiguration>()
            .AddSmsProviderOptionsConfiguration<CustomProviderOptionsConfiguration>();
    }
}
```

`CustomSmsProvider` injects `IOptionsMonitor<CustomSmsOptions>`. In the
settings display driver, after a successful save, inject
`IOptionsUpdateNotifier` (`OrchardCore.Environment.Options`) and call
`RequestUpdate<CustomSmsOptions>().RequestUpdate<SmsProviderOptions>()` so the
monitors refresh after the session commits.

## Workflow SMS Activity

With `OrchardCore.Sms` and `OrchardCore.Workflows` enabled, the **SMS Task**
activity (category **Messaging**, outcomes `Done` and `Failed`) sends a message.
Its fields support Liquid: **Phone Number** (recipient), the optional **From
Phone Number** (with country code, overriding the provider's number), and
**Body**. The persisted activity properties are `PhoneNumber`, `FromNumber`, and
`Body`; the send result is stored in `LastResult`.

```json
{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "OrchardCore.Sms",
        "OrchardCore.Workflows"
      ]
    }
  ]
}
```

## SMS Notifications

Enable `OrchardCore.Notifications.Sms` to deliver user notifications by SMS
according to user preferences (see `orchardcore-notifications`).

```json
{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "OrchardCore.Sms",
        "OrchardCore.Notifications",
        "OrchardCore.Notifications.Sms"
      ]
    }
  ]
}
```

## Health Checks

With `OrchardCore.HealthChecks` enabled, the SMS module adds a health check that
reports the status of the Twilio SMS service (see `orchardcore-health-checks`).

## Upgrading from 3.x

- `IOptions<SmsProviderOptions>`, `IOptions<TwilioOptions>`, and
  `IOptions<AzureSmsOptions>` → `IOptionsMonitor<T>.CurrentValue`; settings
  changes no longer release the shell.
- `OrchardCore.Sms.SmsPermissionProvider.ManageSmsSettings` was removed; use
  `OrchardCore.Sms.SmsPermissions.ManageSmsSettings`.
- `OrchardCore_Sms_AzureCommunicationServices` → `OrchardCore:Sms:Azure`.
- The SMS Task gained the optional **From Phone Number** (`FromNumber`) field
  and now honors workflow cancellation.

Versions

The database has no other skills named orchardcore-sms.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 6b7f3122a4cb (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100orchardcore-sms-azure
    Skill for configuring Azure Communication Services SMS in Orchard Core. Covers AzureSmsSettings, AzureSmsOptions, DefaultAzureSmsOptions, AzureSmsProvider, DefaultAzureSmsProvider, AzureSmsProviderBase, the OrchardCore Sms Azure configuration section, IOptionsMonitor refresh,…
  • 100orchardcore-omnichannel-sms
    Skill for AI-driven SMS automation in Orchard Core with the CrestApps SMS Omnichannel Automation feature CrestApps.OrchardCore.Omnichannel.Sms. Covers dependencies, automatic SMS activity loads driven by a Chat AI profile, SmsOmnichannelProcessor and SmsOmnichannelEventHandler,…
  • 100azure-communication-sms-java
    Send SMS messages with Azure Communication Services SMS Java SDK. Use when implementing SMS notifications, alerts, OTP delivery, bulk messaging, or delivery reports.
  • 100azure-communication-sms-java
    Send SMS messages with Azure Communication Services SMS Java SDK. Use when implementing SMS notifications, alerts, OTP delivery, bulk messaging, or delivery reports.
  • 100azure-communication-sms-java
    Send SMS messages with Azure Communication Services SMS Java SDK. Use when implementing SMS notifications, alerts, OTP delivery, bulk messaging, or delivery reports.
  • 100twilio
    Add SMS, voice calls, and WhatsApp messaging with Twilio. Use when a user asks to send SMS messages, make phone calls programmatically, add two-factor authentication via SMS, send WhatsApp messages, build an IVR system, set up phone number verification, receive incoming SMS, or…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.