SMS texting
authorJason Etheridge <jason@esilibrary.com>
Thu, 22 Sep 2011 13:17:50 +0000 (09:17 -0400)
committerJason Etheridge <jason@esilibrary.com>
Thu, 5 Jan 2012 17:46:01 +0000 (12:46 -0500)
commit6aaadff7103c1b2150cf540fe2faf86b834c455b
tree649f596cca2beae5166194838dc940655a323e16
parent51510f8d3a8765b2805c7bde84b614d9ed74c21e
SMS texting

For SMS functionality we're basically converting a carrier and a phone number
into an email address and sending via SMTP like other email notifications.
There is administrative UI for configuring these mappings:

    Admin -> Server Settings -> SMS Carriers

The permission ADMIN_SMS_CARRIER is needed to use this interface. In a stock
Evergreen installation, this is given to the Global Administrator group.

In this interface, any occurance of "$number" in the Email Gateway field will
change into the pertinent SMS phone number when the mapping gets used. We're not
doing anything fancy here for verifying or munging phone numbers, but you could
do munging in the pertinent SMS Action/Trigger templates, or better, contribute
code for the OPAC templates and/or the utility method get_sms_gateway_email in
Trigger/Reactor.pm.

Our set of stock mappings comes from
http://en.wikipedia.org/wiki/List_of_SMS_gateways

There's no automated process for keeping this up-to-date, though some volunteer
with a Wikipedia account could add the page to their watchlist for changes and
let us know if something needs changing.

Set the org unit setting "SMS: Enable features that send SMS text messages."
(database name "sms.enable") to True to expose the following:

  * SMS notification widgets in the TT-OPAC hold placement interface (to notify
    when a hold is ready for pickup)

  * "(SMS)" links next to call numbers on the TT-OPAC record details page. The
    interface spawned by these links require user authentication by default, but
    this can be changed by setting the org unit setting "SMS: Disable auth
    requirement for texting call numbers." to True. The database name for that
    setting is "sms.disable_authentication_requirement.callnumbers".

  * New options in TT-OPAC My Account -> Account Preferences -> Notification
    Preferences (we also add in some missing prefs for holds outside of SMS)

There are two pertinent Action/Trigger templates under Admin -> Local
Administration -> Notifications / Action Triggers:

  * SMS Call Number
  * Hold Ready for Pickup SMS Notification

Don't disable these. We rely on the sms.enable YAOUS as the master on/off
switch.

Also, it's probably best to have just one sms.enable for the whole consortium.
If you mix and match on/off settings here, then user preferences for SMS can get
blown away if the user updates their settings in the TT-OPAC at an org where SMS
is disabled.  Hrmm, the same would probably happen if the user jumps between the
TT-OPAC and the original JS-PAC.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
18 files changed:
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/SendSMS.pm [new file with mode: 0644]
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/SMS.pm [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.sms_carriers.sql [new file with mode: 0644]
Open-ILS/src/templates/conify/global/config/sms_carrier.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/myopac/prefs_notify.tt2
Open-ILS/src/templates/opac/parts/place_hold.tt2
Open-ILS/src/templates/opac/parts/record/copy_table.tt2
Open-ILS/src/templates/opac/parts/sms_carrier_selector.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/sms_cn.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/conify/global/config/sms_carrier.js [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul