• Resolved joneiseman

    (@joneiseman)


    I found there’s a problem when using wp_sms_send with the ExpertTexting Gateway
    The problem is in the function SendSMS in the file: wp-sms/includes/gateways/class-wpsms-gateway-experttexting.php
    Here are the changes needed to fix the problem:

    
    72,73d71
    <         if (empty($this->from))
    <             $this->from = "DEFAULT";
    75c73,74
    <             $response = wp_remote_get( $this->wsdl_link . "json/Message/Send?username=" . $this->username . "&api_key=" . $this->has_key .  "&api_secret=" . $this->password . "&from=" . $this->from . "&to=" . $to . "&text=" . $text . "&type=" . $type, array('timeout' => 30)); }
    ---
    >             $response = wp_remote_get($this->wsdl_link . "json/Message/Send?username=" . $this->username . "&password=" . $this->password . "&api_key=" . $this->has_key . "&from=" . $this->from . "&to=" . $to . "&text=" . $text . "&type=" . $type, array('timeout' => 30));
    >         }
    

    Note that the one on the left is the new version and the one on the right is the original version.

    Here’s an example of a valid API call:

    
    https://www.experttexting.com/ExptRestApi/sms/json/Message/Send?username=myusername&api_key=myapikey&api_secret=myapisecret&from=DEFAULT&to=15551231234&text=Hello&type=text
    

    In the php file it needs to have the following:

    
    $response = wp_remote_get( $this->wsdl_link . "json/Message/Send?username=" . $this->username . "&api_key=" . $this->has_key . "&api_secret=" . $this->password . "&from=" . $this->from . "&to=" . $to . "&text=" . $text . "&type=" . $type, array('timeout' => 30));
    

    In the plugin settings you need to use the api_secret where it asks for the api_password.

    The API call will not work if $this->from is an empty string (which results in &from=&) and the api_secret needs to be used instead of api_password.

    Is there a github repository for the wp-sms code?

    • This topic was modified 3 years, 4 months ago by joneiseman.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp_sms_send not working with ExpertTexting gateway’ is closed to new replies.