Sms Integration

Hi ,

in controller-------

if(isset($_POST[‘CrmSmsStats’]))

{

      $model->attributes=$_POST['CrmSmsStats'];


      $msg = CrmSms::model()->findByAttributes(array('id'=> $_GET['id']));


      $model->sms_id= $msg->id;


      $model->created_by = yii::app()->session['userid'];


      $currentTime = date('Y-m-d h:i:s');


      $model->sent_date = $currentTime;


      $model->created_user_type = yii::app()->session['usertype'];


      $model->company_id = yii::app()->session['company_id'];


     


    


                   


                 if ($model->validate()) {





                        $model->save();





                        Yii::app()->user->setFlash('create', 'Submitted Successfully');


                        $this->refresh();





                    }

//$this->redirect(array(‘view’,‘id’=>$model->id));

}

in view-----------

<?php

               &#036;data = CHtml::listData(CrmContacts::model()-&gt;findAllByAttributes(array('company_id'=&gt;yii::app()-&gt;session['company_id'])),'mobile_phone','name');


            if(&#036;data){


                    &#036;this-&gt;widget('bootstrap.widgets.TbSelect2', array(


                        'asDropDownList' =&gt; TRUE,


                        'model' =&gt; &#036;model,


                        'attribute' =&gt; &quot;contact_list&quot;,


                        'data'=&gt;&#036;data,


                        'htmlOptions'=&gt;array('multiple'=&gt;'multiple'),


                        'options' =&gt; array(

// ‘tags’ => array(),

// ‘placeholder’ => ‘Choose Skills’,

                            'width' =&gt; '23%',


                            'separator' =&gt; &quot;,&quot;,

// ‘name’=>‘contlist’

                    )));


            }else{


                echo &quot;&lt;label class=&#092;&quot;radio inline&#092;&quot;&gt;No Records.&lt;/label&gt;&quot;;


            }


                    ?&gt; 


              &lt;?php echo &#036;form-&gt;error(&#036;model,'contact_list'); ?&gt;

How to use Api and how to integrate

That really depends on your chosen SMS provider. last time I had to deal with this kind of service, they mostly provided an SMTP-like interface.