Twilio Integration with Koha

Twilio Integration with Koha

Some of our partners subscribe to Twilio for SMS messages and phone notifications from Koha. If you are a ByWater Solutions partner and have a Twilio account, we can help you set up the connection.

Twilio SMS

Twilio sends the SMS notices that Koha generates using the SMS templates. If you already have SMS templates configured, great! If not, edit the notices you would like to send via text and create very simple SMS versions. Patrons will receive SMS notices if SMS is selected in their messaging preferences. 

Navigate to the system preference SMSSendDriver, and type 'Twilio' in the field provided. Be sure to save your changes.


Next, you will need to put in a support ticket for our Systems Team to finish the connection. In the ticket, we will need the following information that you can get from accessing your Twilio account:

Twilio_accountsid:
Twilio_authtoken:
Twilio_from:

The Systems Team will install the Twilio SMS plugin and configure it using your provided credentials. 

Phone numbers for SMS notices

Koha uses the SMS number field at the bottom of patron messaging preferences (SMSAlertNumber in the Koha schema).
Phone numbers need to be in the format of +11234567890. If your phone numbers (in Koha) are not captured in that format, they need to be converted. 
Open a support ticket for help with updating phone numbers to the correct format. 










For those partners switching from another SMS service, the mobile provider does not need to be entered into patrons' accounts for Twilio.

Alert
The default helper text to the right of the SMS number does not describe Twilio's required formatting. To change that text, you can enter the following in the IntranetUserJS system preference: 
/* Modify the sms_number_help text to specify entry for Twilio integration */
$('#pat_memberentrygen .sms_number_help').text("Enter +1 followed directly by the ten-digit number (+11234567890)");

Twilio Voice

Twilio Voice is a bit different and more complex than setting up Twilio SMS. Kyle, one of our ByWater Developers, has released the Twilio Voice plugin for Koha. This development was graciously sponsored by Ajax Public Library in Canada. This plugin allows Koha to send 'phone' notices via the Twilio service API.


Twilio recommends that libraries who will be using Twilio SMS and Twilio Voice create separate accounts for each. This means that ByWater will need the Account SID, Auth Token, and phone numbers for each account.

Koha Configuration

  1. Ensure the system preference PhoneNotification is enabled
  2. Ensure the system preference TalkingTechItivaPhoneNotification is disabled

  1. Make sure the Phone versions of your notices have content. You can see these notices in the Tools module under Notices and slips. When you find the notice you would like to use, click "Edit" and navigate to the Phone tab.


Important to Note:

  1. These notices will be read as-is over the phone via Twilio
  2. It is best to keep notices as succinct as possible
  3. Repeat the entire notice twice in case the call goes to voicemail

Plugin Configuration - SMS and Voice

  1. Create a Twilio account, and log in to Twilio
  2. Create a new project
  3. Get a trial number, or verify an existing phone number for this project
  4. Verify your phone number for testing purposes
  5. Note your Account SID and Auth Token on the project landing page
  6. Browse to the Twilio plugin configuration page in Koha
  7. From there, you can plug in the Account SID, Auth Token, and Twilio phone number from your Twilio project
We hope this helps you get a better understanding of the options when using Twilio with Koha. If you are one of our ByWater partners, and you have questions, please reach out!