[eluser]Corey Freeman[/eluser]
I dunno what's wrong with my code, but I can't get the HTML to render. For some reason it's sending the HTML view in plain text.
Code:
//Email the User
$data['username'] = $this->input->post('username');
$data['password'] = $this->input->post('password');
$username = $this->input->post('username');
$email = $this->input->post('email');
$password = $this->input->post('password');
$data['secret'] = md5($this->input->post('email'));
$this->load->library('email');
$this->email->from('[email protected]', 'CloudReve - Aspiration Sharing');
$this->email->to($email);
$this->email->subject('Please Activate Your CloudReve Account');
$this->email->message($this->load->view('emails/activate', $data, true));
$this->email->set_alt_message('Thank you for signing up to cloudreve.com. Before you can begin sharing your aspirations with others, you need to confirm your email address by visiting this web address: http://www.cloudreve.com/activate/'.md5($email).'');
$this->email->send();
//Log them in for the first time!
$this->db->where('username', $this->input->post('username'));
$query = $this->db->get('users');
foreach($query->result() as $row):
$id = $row->id;
endforeach;
$data = array(
'id' => $id,
'username' => $this->input->post('username'),
'is_logged_in' => true,
'account_active' => false
);
$this->session->set_userdata($data);
VIEW
Code:
<html>
<head>
<title>Activate Your CloudReve Account</title>
</head>
<body style="width: 600px; margin: auto; padding: 50px; font-family: helvetica, verdana, arial, sans-serif; color: #4B5263; font-size: 12px;">
<table style="background: #fff; padding: 10px; width: 100%; line-height: 1.5em;">
<tbody>
<tr>
<td style="text-align: center;"><img src="http://cloudreve.s3.amazonaws.com/email_logo.jpg" alt="CloudReve" /></td>
</tr>
<tr style="width: 100%;">
<td><h3 style="text-align: center; margin-top: 10px;">Please Confirm Your CloudReve Email Address</h3></td>
</tr>
<tr>
<td>Welcome to <a href="http://www.cloudreve.com">CloudReve</a>, the goal and aspiration sharing social network. Before you begin sharing your aspirations with the world, please <a href="http://www.cloudreve.com/activate/<?=$secret?>">confirm your email address by clicking this link.</a></td>
</tr>
</tbody>
</table>
</body>
</html>