diff --git a/lib/GergelyPolonkai/SmsSender/OvhSoapSender.php b/lib/GergelyPolonkai/SmsSender/OvhSoapSender.php new file mode 100644 index 0000000..94fbdf2 --- /dev/null +++ b/lib/GergelyPolonkai/SmsSender/OvhSoapSender.php @@ -0,0 +1,82 @@ +sender_url = $sender_url; + $this->sms_account_id = $sms_account_id; + $this->from = $from; + + /* + * Set up the SOAP handle + */ + try + { + $this->soap_handle = new \SoapClient($this->sender_url); + }catch(\SoapFault $fault) + { + echo $fault; + } + } + + public function login($username,$password) + { + $this->username = $username; + $this->password = $password; + $this->session = $this->soap_handle->login($this->username, $this->password, "fr", false); + return $this->session ? true : false; + } + + public function sendMessage($to, $message) + { + $result = $this->soap_handle->telephonySmsSend($this->session,$this->sms_account_id,$this->from,$to,$message,"","1","",""); + + return $result; + } + + public function logout() + { + return $this->soap_handle->logout($this->session); + } + + + + public function setSmsAccountId($id) + { + $this->sms_account_id = $id; + } + public function setFrom($from) + { + $this->from = $from; + } + public function setMessage($message) + { + $this->message = $message; + } +}