navachaitanya Posted October 25, 2015 Share Posted October 25, 2015 Hi everyone I need help in opencart sms integration, I have php sms gateway API, I want send notification to user when any new user get created account please anyone tell me in which file i need to integrate SMS API for new account notification and here is my PHP SMS API script <?php $sender_id=’abc’; // sender id $mob_no = ’123,456'; //123, 456 being recepients number $pwd=’xxxx’; //your account password $msg=hi%20everyone’; //your message $str = trim(str_replace(‘ ‘, ‘%20', $msg)); // to replace the space in message with ‘%20’ $url="http://login.smsgatewayhub.com/smsapi/pushsms.aspx?user='.$user.’&pwd='.$pwd.'&to=’.$mob_no.’&sid=’.$sender_id.’&msg=’.$str.’&fl=0&gwid=2'; // create a new cURL resource $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL,$url); // grab URL and pass it to the browser curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch); ?> Quote Link to comment Share on other sites More sharing options...
printf Posted October 26, 2015 Share Posted October 26, 2015 create a new method with your sms code in the class "ControllerAccountRegister extends Controller", then call that method right before... // your sms method call here... $this->sendSMS(); $this->response->redirect($this->url->link('account/success')); but I myself would turn it into an extension, that way I could control it from the admin panel... but how to do that goes beyond the scope of a scripting help forum. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.