SMS mobile phone messages - MikeBlyth/mission_database GitHub Wiki

The application needs at least one external gateway for sending SMS. Currently only Clickatell is configured, but Twilio ought to be added. (The lower-cost Twilio is already being used in the sister project, Mission Net.)

In terms of program structure, SMS messages are sent via objects of class SmsGateway (app/models/sms_gateway.rb). SmsGateway itself is just an abstract class which knows how to initialize parameters from the site_settings table and to log messages. An actual gateway such as ClickatellGateway must instantiate the methods for connecting with the gateway provider, sending messages, and tracking the results. [Presently there is still some undesirable linkage in that the messages model depends on the ClickatellGateway, because that’s the only gateway object present. It would be better change this to what is used in Mission Net, shifting all the provider-dependent functionality into the gateway object.]

Diagram of SMS broadcast