Messages are sent twice
Closed this issue · 1 comments
kaylucas commented
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;
}