Add-on Documentation from JCOGS Design

IntroductionLast updated: 3 February 2026

JCOGS OTP Pro - SMS (Twilio) is a companion add-on for ExpressionEngine that extends JCOGS OTP Pro with SMS delivery via Twilio. It allows OTP Pro verification payloads (typically one-time codes) to be delivered to members by text message.

This is a companion add-on: it does not provide a standalone SMS system. It adds an additional delivery method inside OTP Pro.

Core Capabilities

  • SMS delivery transport for OTP Pro
    Adds a new delivery provider (transport) to OTP Pro: SMS (Twilio).
  • Member field phone number source
    Uses a nominated ExpressionEngine Member Field as the phone number source (recommended format: E.164).
  • Availability-aware selection
    If a member does not have a valid phone number, the SMS option can be hidden from delivery method selection.
  • Operational testing support
    Includes an optional dry-run mode for the OTP Pro Provider Test screen, which is useful while Twilio account compliance is pending.

How SMS (Twilio) Works

This add-on registers a delivery provider with OTP Pro. When OTP Pro chooses the SMS (Twilio) transport, it builds the payload (for example a code) and then requests that it be delivered. The provider resolves the recipient phone number from the configured member field, normalises it to E.164, and submits a message to Twilio's Messaging API.

The provider identifier used internally by OTP Pro is sms_twilio.

Phone Number Field

You should create a dedicated member field to store phone numbers and ensure it contains E.164 values (for example +447700900123). This helps avoid delivery failures and ensures the SMS delivery option can be shown/hidden reliably.

  • Recommended storage: a dedicated Member Field (Text or Textarea).
  • Recommended format: E.164 only (must start with + and contain digits only).
  • Availability behaviour: on the front-end, SMS (Twilio) will only be offered when the current member has a valid phone number in the nominated field.

Minimum Requirements

SMS (Twilio) requires ExpressionEngine 6.4.18+ (including EE7+) and PHP 8.2+. It also requires JCOGS OTP Pro to be installed and enabled.

  • Twilio: an account that is permitted to send SMS in your target region(s).
  • Sender: an SMS-capable Twilio phone number in E.164 format.

Twilio Compliance / Regulatory Requirements

In some regions, Twilio requires additional regulatory/compliance setup (for example A2P/10DLC registration or a "regulatory bundle") before SMS sending is permitted. There is no supported way to bypass these requirements.

While approval is pending, you can enable the provider's Dry-run in Provider Test option to confirm your OTP Pro configuration and UI integration without sending real SMS.

Configuration

Configure the provider in the OTP Pro Control Panel: Add-ons → JCOGS OTP Pro → Provider Configuration → SMS (Twilio)

You will be prompted for the following fields:

  • Twilio Account SID (starts with AC…)
  • Twilio Auth Token (keep this secret)
  • From Number (your SMS-capable Twilio number, E.164)
  • Member Phone Field ID (select the member field containing the recipient phone number)
  • Message template (supports placeholders such as {payload}, {site_name}, {member_name}, {support_email})
  • Dry-run in Provider Test (optional)
  • API Base URL (advanced, optional; leave blank for default)

Testing Your SMS Connection

Provider Test (Control Panel)

  1. Ensure the provider is fully configured (including Member Phone Field ID).
  2. Go to Add-ons → JCOGS OTP Pro → Delivery Providers → Test.
  3. Select SMS (Twilio).
  4. Enter a test recipient number in E.164 format (for example +447700900123).
  5. If Dry-run in Provider Test is enabled, the send will be simulated. If disabled, a real Twilio API call will be made.

Full OTP flow (front-end)

Once Twilio is permitted to send SMS on your account, complete a full OTP challenge flow and confirm that:

  • SMS (Twilio) appears as a delivery option for members with a valid phone number.
  • The member receives the message promptly.
  • The payload/code validates successfully in OTP Pro.

Security Notes

  • Protect your Auth Token: treat it like a password. Do not store it in templates or version control.
  • Least privilege: use a dedicated Twilio project/account for production where appropriate.

Common Issues

  • Invalid phone number: this provider requires a strict E.164 style value (must start with + and contain digits only).
  • Twilio trial restrictions: you may need to verify recipient numbers before SMS sending is allowed.
  • Compliance required: messages may fail until Twilio regulatory requirements are approved for your region.

Installation

  • Copy the jcogs_otp_sms_twilio folder to system/user/addons and install via the ExpressionEngine Control Panel.
  • In JCOGS OTP Pro, enable/configure the SMS (Twilio) provider and select the member field used for phone numbers.

Companion Add-ons

SMS (Twilio) is a companion add-on for JCOGS OTP Pro. It can be used alongside other companions, for example:

  • HTML Emails: for branded email templates when delivering verification by email.
  • Magic Links: for low-friction “click-to-verify” sign-in links by email.

Top Tip

Start by validating phone number formatting (E.164) for a test member, then use OTP Pro's Provider Test screen. If Twilio compliance is still pending, enable Dry-run in Provider Test so you can validate your OTP Pro integration without sending real SMS.