Manually sending individual or bulk SMS messages

Sending SMS messages

There are two possible ways to send SMS messages from the server (either to an individual, or to a group of users): using the Web site interface in the Administration section, or using a direct SQL connection to the database.

Web site interface

  • Log in to iSIKHNAS as an administrative user
  • Go to Administration | SMS metadata | Send SMS Message(s)

Manual sending via direct database insert

Administrators with appropriate database privileges can send messages by directly inserting them into the SMS outbox table on the database, using a message id of '0'. The table is checked periodically for any messages with an ID of zero, which are then automatically sent.

To insert messages into the table, use the following generic SQL structure:

insert into outbox (phone, message, msgid, createdby)
select 
   phone, 
   'Message to send', 
   0, 
   2  -- id of the current user (person creating the messages)
from users u
where not u.del
and phone is not null
and left(phone,2) = '62' -- only numbers in Indonesia
-- add any other filters here. For example
-- and groupid = 4 -- filter for a specific user group

Be very careful of this approach as poorly formed SQL can accidentally generate very large numbers of messages.