Ben,
the concept of email-templates seems very useful to customize the appearance of activation emails etc.
However,at this time the subject is still hard coded. I would propose to put subject and message into the same view and separate them with ###markers###.
Here my activate.tpl.php (in my case for text emails)
###subject###
<?php echo $this->config->item(‘site_title’, ‘ion_auth’) . ’ - Test: Account Activation’ ?>
###message###
Activate account for <?php echo $identity;?>
Test: Please click this link to Activate Your Account:
<?php echo base_url().‘auth/activate/’. $id .’/’. $activation;?>
and here some changes in function register of the library:
$message = $this->ci->load->view($this->ci->config->item('email_templates', 'ion_auth').$this->ci->config->item('email_activate', 'ion_auth'), $data, true);
$subject = substr($message, 0, strpos($message, '###message###'));
$message = trim(str_replace($subject.'###message###', '', $message));
$subject = trim(str_replace('###subject###','',$subject));
$this->ci->email->clear();
$config['mailtype'] = ($this->ci->config->item('mailtype', 'ion_auth')) ? $this->ci->config->item('mailtype', 'ion_auth') : 'html'; // gradido: mailtype from config
$this->ci->email->initialize($config);
$this->ci->email->set_newline("\r\n");
$this->ci->email->from($this->ci->config->item('admin_email', 'ion_auth'), $this->ci->config->item('site_title', 'ion_auth'));
$this->ci->email->to($email);
if($subject) $this->ci->email->subject($subject);
else $this->ci->email->subject($this->ci->config->item('site_title', 'ion_auth') . ' - Account Activation');
$this->ci->email->message($message);
I tested it with the register / activate emails. The code is backward compatible. The other email-functions should be similar.
Best regards
Bernd