{% extends "layouts/workspace_settings.html" %} {% load common_extras %} {% comment %} Connect a Twilio number. Same shape as telegram_connect.html — see the note there for why content_wrap is cleared and why the platform key is written once. The one thing this page does differently: the two sender fields are mutually exclusive, so they are grouped under their own heading with a divider between them rather than left as two more boxes in the run with a sentence explaining the rule. Give one or the other, not both. Full setup notes live in docs/channels/sms.md. {% endcomment %} {% block title %}Connect Twilio · DemandTrail Messaging{% endblock %} {% block content_wrap %}{% endblock %} {% block content %} {% with platform_key="sms" %}
{% include "partials/_platform_icon.html" with platform=platform_key size="lg" only %}

Connect a Twilio number

DemandTrail Messaging sends SMS through your own Twilio account, so the messages, the number and the bill are all yours. The Auth Token is the whole credential: anyone holding it can send as your number and read your messages, so it is stored encrypted and never shown again.

{% if error %}
{{ error }}
{% endif %}

Before you paste

  1. Open the Twilio console and copy the Account SID and Auth Token from the dashboard.
  2. Copy either a phone number you own, in E.164 form (+15551234567), or a Messaging Service SID (MG…) if you send through one.
  3. US traffic also needs A2P 10DLC registration, which happens in Twilio and not here. There is a checklist on the SMS settings page.
{% csrf_token %}

Your Twilio account

Starts with AC.

{% comment %} autocomplete="off" and a password input: this value is a live credential and must not end up in the browser's saved form data. It is also never rendered back — a failed submit clears it deliberately. {% endcomment %}

Pasted once. We check it with Twilio before saving anything.

Where messages are sent from

Give one or the other, not both.

or

What happens next

{% comment %} No copy field here: the webhook URL is per connection and does not exist until this form succeeds. It lives on the connection's own page, which is where somebody pasting it into Twilio is already standing. {% endcomment %}

We check the credentials and confirm the sender belongs to the account, then store the connection. Twilio has no way for us to configure your number remotely, so the last step is yours: open the number (or the messaging service) in the Twilio console and paste the webhook URL shown on the connection's page into A message comes in, as a POST.

That URL has to match exactly, trailing slash included: Twilio signs each delivery with an HMAC computed over the URL itself, so a URL that differs by one character fails verification. It also has to be reachable from the public internet over HTTPS. Full setup notes are in docs/channels/sms.md.

Back to channels
{% endwith %} {% endblock %}