Lines 1-6
Link Here
|
1 |
package C4::SMS; |
1 |
package C4::SMS; |
2 |
|
2 |
|
3 |
# Copyright 2007 Liblime |
3 |
# Copyright 2007 Liblime |
|
|
4 |
# Copyright 2015 Biblibre |
5 |
# Copyright 2016 Catalyst |
4 |
# |
6 |
# |
5 |
# This file is part of Koha. |
7 |
# This file is part of Koha. |
6 |
# |
8 |
# |
Lines 28-34
my $success = C4::SMS->send_sms({ message => 'This is my text message',
Link Here
|
28 |
|
30 |
|
29 |
=head1 DESCRIPTION |
31 |
=head1 DESCRIPTION |
30 |
|
32 |
|
|
|
33 |
A wrapper for SMS::Send. |
31 |
|
34 |
|
|
|
35 |
Can use a yaml file for config, the path to which is in the koha-conf.xml |
36 |
<sms_send_config>__KOHA_CONF_DIR__/sms_send/</sms_send_config> |
37 |
|
38 |
Each file needs to be in the format of |
39 |
__KOHA_CONF_DIR__/sms_send/<driver>.yaml |
40 |
|
41 |
For example for SMS::Send::UK::Kapow the config would be |
42 |
|
43 |
/etc/koha/sites/instancename/sms_send/UK/Kapow.yaml for package install |
44 |
or |
45 |
/etc/koha/sms_send/UK/Kapow.yaml for tarball |
46 |
|
47 |
A underscore character is prepended to all parameter names so they are |
48 |
treated as driver-specific options (leading underscore must not appear |
49 |
in config file). |
32 |
|
50 |
|
33 |
=cut |
51 |
=cut |
34 |
|
52 |
|
Lines 77-86
sub send_sms {
Link Here
|
77 |
my $subpath = $driver; |
95 |
my $subpath = $driver; |
78 |
$subpath =~ s|::|/|; |
96 |
$subpath =~ s|::|/|; |
79 |
|
97 |
|
80 |
my $conf_file = File::Spec->catfile( |
98 |
my $conf_file = |
81 |
C4::Context->config('installdir'), |
99 |
File::Spec->catfile( C4::Context->config('sms_send_config'), $subpath ) |
82 |
'etc', 'sms', 'driver', $subpath |
100 |
. q{.yaml}; |
83 |
) . q{.yaml}; |
|
|
84 |
my %args; |
101 |
my %args; |
85 |
if ( -f $conf_file ) { |
102 |
if ( -f $conf_file ) { |
86 |
require YAML; |
103 |
require YAML; |