Kyle M Hall
00c89d915b
Nearly all cellular providers allow a person to send an text message to a cellular phone by sending an email to phonenumber@provider. We can leverage this capability to add the ability for Koha to send sms messages to patrons without the need to subscribe to an sms gateway server. Basic plan: 1. Add a table sms_providers to the db to tell Koha what service providers are available, and what domain emails should be sent to. 2. Add borrowers.sms_provider_id to tell Koha which mobile service the patron subscribes to for the number given in smsalertnumber 3. Modify Koha to send an email rather than using SMS::Send if the driver is set to 'Email' Test plan: 0) Get a mobile phone 1) Apply the patch 2) Run updatedatabase.pl 3) Set the value of SMSSendDriver to 'Email' 4) Go to the admin page, the "Additional parameters" area should now have the link "SMS cellular providers" 5) On this page, add some providers. Make sure to add the provider for your own cellular phone service. Here are some examples: Sprint phonenumber@messaging.sprintpcs.com Verizon phonenumber@vtext.com T-Mobile phonenumber@tmomail.net AT&T phonenumber@txt.att.net Only add the domain part in the 'domain' field. So for Verizon, that would be 'vtext.com' 6) Create an account for yourself, add your SMS number, and select your provider from the dropdown box directly below it. 7) Enable SMS messaging for Item check-in and Item checkout 8) Check out an item to yourself 9) Run process_message_queue.pl 10) Wait! You should receive a text message shortly, when I tested it, I received my sms message within the minute. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
41 lines
1.2 KiB
Perl
Executable file
41 lines
1.2 KiB
Perl
Executable file
#!/usr/bin/perl
|
|
|
|
# This file is part of Koha.
|
|
#
|
|
# Koha is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# Koha is distributed in the hope that it will be useful, but
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with Koha; if not, see <http://www.gnu.org/licenses>.
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use CGI qw ( -utf8 );
|
|
use C4::Auth;
|
|
use C4::Output;
|
|
|
|
|
|
|
|
my $query = new CGI;
|
|
my ($template, $loggedinuser, $cookie)
|
|
= get_template_and_user({template_name => "admin/admin-home.tt",
|
|
query => $query,
|
|
type => "intranet",
|
|
authnotrequired => 0,
|
|
flagsrequired => {parameters => '*'},
|
|
debug => 1,
|
|
});
|
|
|
|
$template->param(
|
|
SMSSendDriver => C4::Context->preference('SMSSendDriver'),
|
|
);
|
|
|
|
output_html_with_http_headers $query, $cookie, $template->output;
|