Here is my code
$success = $this->user_model->get_user($user_id);
//$success variable contains some array values
if($success){
$this->email->from('[email protected]'));
$this->email->to($success->email);
$this->email->subject('New user registration and update');
$message = $this->load->view('email/view_adduser', $success, true);
$this->email->message($message);
$this->email->send();
}
Email is sucessfully sent, but data aren't displaying there. And here is my email view template(email/view_adduser.php)
<h2>Hello Sir/Madam</h2><br />
<p>Your Login credientials are provided below</p><br />
<p>Please <a href="<?php echo base_url().'admin'; ?>" >Login</a>
To access your account </p><br />
<p>Username & Password : - <?php echo $success->username;?></p><br />
Here username is not displaying in the email. Anybody have any idea??? Thanks in advance
var_dump($success)and see what is displayed.