title: sending email using templates in codeigniter
body: <p>I have to send weekly reports to my users.
  I am using an email template from view.
  My code in controller is </p>
  
  <pre class="lang-php prettyprint-override"><code>function sendWeeklyMail(){
      if(!$this-&gt;session-&gt;userdata('some'))
          redirect('admin/admin','refresh');
     $data=$this-&gt;admin_model-&gt;getUserData();
     foreach($data as $u){
          $this-&gt;email-&gt;clear();
  
          $this-&gt;email-&gt;to($u-&gt;Email);
          $this-&gt;email-&gt;from('your@example.com');
          $this-&gt;email-&gt;subject('Here is your info '.$name);
          $this-&gt;email-&gt;message('email/report',$data,'true');
          $this-&gt;email-&gt;send();
         }
     }
  }
  </code></pre>
  
  <p>My question is how do i send the data so that i can show the user some data in the body of the message. Usually codeigniter takes data as     $data['user_data']</p>