title: Using a HTML Mail template with codeigniter
body: <p>I am using the codeigniter email class to send emails when the user register to my website or perform some activity inside my website.</p>
  
  <p>The thing is that, with this simple code below I can only send very simple HTML emails. And also I will have to pass the entire HTML message to the function. Is there any way so that I could load the entire template in the function itself and just pass a message which is to be placed inside the template as we do in codeigniter with views.</p>
  
  <pre><code>$message = 'Thank you for your order \n';
  $message .= 'We will contact you soon';
  $this-&gt;email($message);
  
  public function email($message = NULL){
      $this-&gt;load-&gt;library('email');
  
      $this-&gt;email-&gt;mailtype('html');
      $this-&gt;email-&gt;from('abbbba@gmail.com', 'Sohan Kc');
      $this-&gt;email-&gt;to('abbbbaa@gmail.com'); 
  
      $this-&gt;email-&gt;subject('Email Test');
      $this-&gt;email-&gt;message($message);    
  
      $this-&gt;email-&gt;send();
  }
  </code></pre>