Git Product home page Git Product logo

sms-send-twilio's People

Watchers

 avatar  avatar  avatar  avatar  avatar

sms-send-twilio's Issues

Support setting from INI file

It would be nice if you built your object on top of SMS::Send::Driver::WebService so you could save account settings in standard INI file.

/etc/SMS-Send.ini
[Twilio]
username=ACb657bdcb16f06893fd127e099c070eca
password=b857f7afe254fa86c689648447e04cff
from=+15005550006

Then the constructor is simply.
use SMS::Send;
my $cheapest_sms_driver='Twilio';
my $sender = SMS::Send->new($cheapest_sms_driver);

See Also: SMS::Send::NANP::TextPower, SMS::Send::NANP::Raco_TMO

Cannot escape utf8 characters

We are getting errors like this:

Can't escape \x{014D}, try uri_escape_utf8() instead at /usr/local/share/perl/5.28.1/WWW/Twilio/API.pm line 116.

It appears that WWW::Twilio::API has a param "utf8" for new() that would cause the module to use uri_escape_utf8, but there doesn't appear to be a way to enable it in SMS::Send::Twilio.
If it could be added as a parameter to new() that would be great!

Upgrade to /Messages resource URI

You may want to consider this: https://support.twilio.com/hc/en-us/articles/223181028-Switching-from-SMS-Messages-resource-URI-to-Messages-resource-URI-

It seems to reduce to simply update only one line of code.

For such a minimal change I'm neglecting doing a pull request right now...

In Twilio's console the change is evident in that requests using [the deprecated] SMS/Messages have no "Delivery Steps", while the ones using /Messages have. It may be not a critical feature, but it is certainly a useful one.

Error in sample code

In your sample code you show the following

_auth_token => 'b857f7afe254fa86c689648447e04cff',

it should be

_authtoken => 'b857f7afe254fa86c689648447e04cff',

Otherwise you get the following error: SMS::Send::Twilio->new requires _authtoken parameter

send_sms die-ing change

I was confused about commit 00458bb and die-ing if send_sms fails.

The POD docs say this about new:

Returns a new SMS::Send object, or dies on error.

But regarding send_sms they say:

The send_sms returns true if the message was sent, or the driver is fire-and-forget and unable to determine success, or false if the message was not sent.

Also, the code for SMS::Send::send_sms has:

        # Merge params and hand off
        my $rv = $self->_OBJECT_->send_sms(
                text => $text,
                to   => $to,
                $self->_PRIVATE(@_),
        );

        # Verify we get some sort of result
        unless ( defined $rv ) {
                Carp::croak("Driver did not return a result");
        }

        return $rv;

So the code that is calling the Twilio driver only croaks if an undef is returned. It's expecting a true/false from the driver which is returned to the caller.

I can understand die/croak-ing if something goes wrong in new but die/croak-ing in send_sms doesn't seem to match what SMS::Send expects. In the situation where the driver is working and configured but there is a problem with sending to Twilio, I would expect a true/false result.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.