Documentation

✉️ Email Delivery

Documentation, reference material and tutorials for CRM-NG SMTP Email: setup guides for every mail service, troubleshooting, and one article per error message.

SMS alerts with Twilio

Updated

By Duane GarnerChief Executive Officer (CEO)
Summarize: Claude ChatGPT View Markdown
On this page

Get a text message on your phone whenever your site fails to send an email, using your own Twilio account.

This article shows you how to receive a text message each time CRM-NG SMTP fails to send an email. It uses Twilio, a service that sends SMS messages for you. It is for site owners who want to be alerted on their phone, even when they are away from their desk.

SMS alerts go straight from your web server to Twilio. They do not depend on your mail service.

Before you start

You need:

  • A Twilio account. Twilio charges per message; check its current prices for your country.
  • A Twilio phone number that can send SMS. This is the "from" number.
  • The mobile number that should receive alerts. This is the "to" number.

Trial accounts

On a Twilio trial account, you can usually only send to phone numbers you have verified in the Twilio console, and messages may carry a trial notice. Verify your own mobile number, or upgrade the account, before relying on alerts.

Some countries have extra rules for business SMS, such as registering your sender. Twilio's console tells you if this applies to your number.

Step 1: Collect your details in Twilio

Twilio's console layout changes from time to time. Look for these names if a page looks different.

  1. Sign in to the Twilio console

    Go to https://console.twilio.com/.

  2. Copy your Account SID

    On the account dashboard, find Account Info. Copy the Account SID. It starts with AC.

  3. Copy your Auth Token

    In the same area, reveal and copy the Auth Token.

  4. Find your Twilio number

    Open the list of active phone numbers and copy the number you will send from.

Write both phone numbers in international format, with a plus sign and country code and no spaces, for example +15551230000 or +447700900123.

Step 2: Add the details in CRM-NG SMTP

  1. Open the Alerts tab

    Go to CRM-NG SMTP → Settings → Alerts and scroll to Twilio SMS.

  2. Enter the account details

    On the Account SID / token row, put the SID in the first box (Account SID) and the token in the second box (Auth token).

  3. Enter the phone numbers

    On the From / to phone row, put your Twilio number in the first box and your mobile number in the second.

  4. Save

    Press Save Alert Settings.

All four values must be filled in, or no SMS is sent.

After saving, the token box shows Token saved. The token is stored encrypted and never shown again. Leave the box empty to keep it, or type a new token to replace it.

What the text says

Each SMS is one short line:

[Your Site Name] WordPress email failed — (error text from your mailer)

Long error messages are split by Twilio into several parts, and each part is charged.

Watch your costs

One SMS is sent for every failed email. If your mailer goes down on a busy site, that could be hundreds of messages. Consider setting a spending limit or usage alert in Twilio, and pair SMS with a cheaper channel such as Slack.

Step 3: Test it

On a staging site, or at a quiet time, put a wrong key or password into your mailer settings on the General tab and send a test from Tools → Email Test. Your phone should buzz. Then put the right settings back and send another test.

Troubleshooting

  • No text arrives. Check all four boxes are filled and saved. In the Twilio console, open the messaging logs: if the message is listed with an error, Twilio explains why, such as an unverified number on a trial account.
  • Nothing appears in Twilio's logs. Your web host may be blocking outbound HTTPS requests to api.twilio.com. Ask your host to allow it.
  • You rotated the Auth Token in Twilio. Paste the new token on the Alerts tab and save. The old one stops working at once.
Go to Top