gr8shivam / laravel-sms-api

Laravel package to provide SMS API integration.
MIT License
99 stars 30 forks source link

package not working on sms.com.ng #20

Closed Unstinted closed 3 years ago

Unstinted commented 4 years ago

Api not working on sms.com.ng please how can i fix it

'sms.com.ng' => [ 'url' => 'https://sms.com.ng/sendsms.php?', 'params' => [ 'send_to_param_name' => 'to', //Send to Parameter Name 'msg_param_name' => 'message', //Message Parameter Name 'others' => [ 'user' => '****', 'password' => '****', 'senderid' => 'sms.com.ng', ], ], 'add_code' => true, //Include Country Code ],

smsapi()->gateway('sms.com.ng')->sendMessage($to, $message, ["user" => "**"], ["password" => "***"], ["senderid" => "sms.com.ng"]);

Unstinted commented 4 years ago

No reply from you, do you still support this package

gr8shivam commented 4 years ago

Hello @Unstinted , the package is very much supported but you may need to wait for weekends.

**Referring to https://sms.com.ng/api, here are some quick suggested changes:

  1. You need to set the send_to_param_name as mobile.
  2. Set add_code to false

Revised config:

//    Gateway Configuration
    'smscomng' => [
        'method' => 'GET', 
        'url' => 'https://sms.com.ng/sendsms.php?',
        'params' => [
            'send_to_param_name' => 'mobile', 
            'msg_param_name' => 'message',
            'others' => [
                'user' => 'PUT_USERNAME_HERE',
                'password' => 'PUT_PASSWORD_HERE',
                'senderid' => 'SMS.com.ng',
            ],
        ],
        'add_code' => false, 
    ],

You can now send SMS like smsapi()->gateway('smscomng')->sendMessage("08157165603", "HelloWorld");

Also, if you have just one gateway, you can replace the default gateway at top of config file in the line 'default' => env('SMS_API_DEFAULT_GATEWAY', 'smscomng'),

gr8shivam commented 3 years ago

Hi @Unstinted , I hope the issue has been resolved. Please reopen the issue if there's any concern.