Mojolicious::Plugin::SMS - Easy SMS sending from Mojolicious apps
# Mojolicious::Lite plugin 'SMS' => { driver => 'Test' }; # Mojolicious $self->plugin(SMS => { driver => 'Nexmo', _username => 'testuser', _password => 'testpassword' _from => 'Bender' }); # in controller named params $self->sms( to => '+380506022375', text => 'use Perl or die;' ); # in controller positional params $self->sms('+380506022375', 'use Perl or die;');
Provides a quick and easy way to send SMS messages using SMS::Send drivers (of which there are many, so chances are the service you want to use is already supported; if not, they're easy to write, and if you want to change providers later, you can simply update a few lines in your config file, and you're done.
Mojolicious::Plusin::SMS has one required option 'driver', all other options are passed to appropriate SMS::Send driver.
driver
SMS::Send driver name. This is a required option. You may specify 'Test' if you need a testing driver.
Mojolicious::Plugin::SMS implements one helper.
Send an SMS message. You can pass the destination and message as positional params:
sms $to, $message;
Or, you can use named params:
sms to => $to, text => $message;
The latter form may be clearer, and would allow any additional driver-specific parameters to be passed too, but the former is terser. The choice is yours.
Mojolicious::Plugin::SMS inherits all methods from Mojolicious::Plugin and implements the following new ones.
register
$plugin->register;
Register plugin hooks and helpers in Mojolicious application.
Mojolicious, SMS::Send, SMS::Send::Test.
Yuriy Syrota <ysyrota@gmail.com>
Copyright (C) 2011 by Yuriy Syrota.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mojolicious::Plugin::SMS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::SMS
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::SMS
For more information on module installation, please visit the detailed CPAN module installation guide.