Home Knowledge Base WP Activity Log How to integrate the plugin with Twilio for instant SMS messages

How to integrate the plugin with Twilio for instant SMS messages

The WP Activity Log plugin can be configured to send you instant SMS notifications about important WordPress site changes. To send SMS messages, you need to integrate the plugin with the Twilio cloud communications platform.

WP Activity Log has out-of-the-box support for Twilio, so configuring the integration only takes a few seconds. To set up the integration, you will need the Twilio number or Alphanumeric ID, the Account SID, and the Auth Token.

Read this KB entry for a step-by-step explanation of how to configure the plugin to send SMS messages.

Step 1: Configuring the integration with Twilio

There are two ways to configure this integration: via the plugin interface or by defining constants in your websiteโ€™s wp-config.php file.

When configured through the plugin interface, the Account SID and authentication token are stored in the WordPress database. Alternatively, you can define these values as constants in the wp-config.php file. In this case, the credentials are not stored in the database, reducing the risk of exposure in the event of a database breach.

Important: when a constant is defined in the wp-config.php, it takes priority over the value stored in the database (configured via the plugin’s interface).

Configuring the integration via the plugin’s interface

  1. Create a Twilio account, or if you have one, use the existing one.
  2. Login to the Twilio Console.
Twilio Console
  1. Navigate to the WP Activity Log > Notifications and then click on Settings from the side menu
  2. Scroll down to the Twilio SMS account section and copy the numbers highlighted in the above screenshot in their respective fields.

Configuring the integration in wp-config.php

Add the below constants to the wp-config.php file to set up the integration, and replace the values with your Account SID, authentication token, and phone number:

define('WSAL_TWILIO_ACCOUNT_SID', 'your_account_sid');
define('WSAL_TWILIO_AUTH_TOKEN', 'your_auth_token');
define('WSAL_TWILIO_PHONE_NUMBER', '+1234567890');

Once defined, navigate to WP Activity Log > Notifications > Settings to confirm that the credentials are being read correctly. This will be confirmed in the plugin’s interface.

Step 2: Integration ready. Test the SMS notifications

That is it! The integration with the Twilio service is ready. Before configuring any notifications you should test the integration. To test the integration scroll down to the Default templates section, click on the SMS template tab and finally, click on the Send test sms button to send a test SMS message.

Step 3: Configure the notification triggers in the plugin

The last step of the process is to configure the notification triggers. These are criteria you configure in the plugin, to tell the plugin when to send you or your team a SMS message. Below is a link to the documentation about configuring notification triggers in the plugin:

  1. Getting started with email & SMS notifications for the WordPress activity log
  2. Instant SMS notifications for WordPress site administrators

Should you require any further assistance or have any questions about SMS notifications, Twilio or the plugin itself please open a support ticket.

Close the CTA
Were you able to find what you were looking for?