Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages are sent twice #1

Closed
kaylucas opened this issue May 30, 2016 · 1 comment
Closed

Messages are sent twice #1

kaylucas opened this issue May 30, 2016 · 1 comment

Comments

@kaylucas
Copy link

kaylucas commented May 30, 2016

Thanks for creating the plugin, it's a nice wrapper for the Plivo PHP package. I found a small bug in it. Currently all messages are sent twice because you call the send_message function twice (line 123 to 125 of plivo.php):

$response = $sendsms->send_message($params);
if($sendsms->send_message($params))

If you change the if statement so it takes the response as a result it will work better. The if statement also wasn't working (because you always got an object back it would always say it is sent successfully) so I changed the code to this:

$response = $sendsms->send_message($params);

        if($response["status"] == 202)
        {
            return "success";
        }
        else
        {
            return $response;
        }
lakshmaji added a commit that referenced this issue Jun 6, 2016
Removed the send message statement in if condition and added condition to check response status
@lakshmaji
Copy link
Owner

hi @kaylucas , Thank for notifying me about that Redundancy.
I have resolved the issue please check once.

lakshmaji pushed a commit that referenced this issue May 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants