Skip to main content

Twilio Configuration

To use the Centro de mensajes (Message Hub) plugin with WhatsApp or SMS, you need a Twilio account properly configured. This guide walks you through the process of setting up your account, acquiring a number, and creating message templates.

1. Create a Twilio Account

  1. Go to the Twilio Sign Up page.
  2. Enter your details and verify your email address.
  3. Verify a personal phone number to unlock your trial or full account.
  4. Go to administration panel https://console.twilio.com/

Twilio Sign Up

2. Buy a Twilio Phone Number

  1. In the Twilio Console, go to Develop > Phone Numbers > Manage > Buy a number. Buy a number link

  2. Search for a number in your desired country. Search and list numbers

  3. Important: Ensure the number has SMS and Voice capabilities. Voice is often required for WhatsApp verification.

  4. Purchase the number.

    Purchase completed

    Purchase confirmation

3. Set Up WhatsApp Business

  1. Navigate to Messaging > Senders > WhatsApp Senders.
  2. Click on Sign up with Meta (Cloud API) or the Guided Setup.
  3. You will be prompted to log in to your Facebook Business Manager.
  4. Follow the steps to link your Twilio number with a WhatsApp Business Profile. You can find more details in the Twilio WhatsApp Self-Sign-Up documentation:

WhatsApp Business Setup Continue with Meta 1 Continue with Meta 2 Continue with Meta 3 Continue with Meta 4 Continue with Meta 5 Continue with Meta 6 Continue with Meta 7 Continue with Meta 8 Continue with Meta 9

  1. Verify your phone number via SMS or a phone call through the Twilio console.
  2. Wait for Meta's approval (usually takes a few minutes to 24 hours). WhatsApp Setup Complete

4. Create a Message Template

WhatsApp requires pre-approved templates for outgoing messages.

  1. Go to Messaging > Content Editor or WhatsApp Senders > Templates.
  2. Click Create New.
  3. Define your template:

Create Template Step 1 Create Template Step 2 Create Template Step 3 Create Template Step 4 Create Template Step 5

  1. Submit for approval. Once approved, note down the Template SID (starts with HX...). Template Approved

5. Required Values for Moodle

Once everything is configured, you must copy these 4 values into the Moodle plugin settings:

ValueDescriptionWhere to find it
Account SIDYour unique account identifier.Twilio Console Dashboard.
Auth TokenSecret key for API access.Twilio Console Dashboard (keep it secret).
Twilio NumberThe number you purchased (in E.164 format, e.g., +123456789).Phone Numbers > Manage.
Template SIDThe ID of your approved WhatsApp template.Messaging > Content Editor / Templates.

Required Credentials

[!IMPORTANT] Without a verified WhatsApp Template SID, you will only be able to send messages if the user has messaged you first within the last 24 hours. Approved templates are required to initiate conversations.