I am working in Codeigniter framework. I have written send email code using its email library that looks like below :
$this->load->library('email', $config);
$this->email->set_newline("
");
$this->email->from('info@webbrainstechnologies.com', 'Instagram Shop');
$content = array(
'user_id' =>$user_id,
'first_name' =>$this->input->post('first_name'),
'last_name' =>$this->input->post('last_name'),
'mobile' =>$this->input->post('mobile_no'),
'email' =>$this->input->post('email'),
'address' =>$this->input->post('address'),
'payment_type' =>$this->input->post('payment_type'),
'comment' =>$this->input->post('comment'),
'order_date' =>date("Y-m-d h:i:sa")
);
$data['content'] = $content;
$this->email->to($to); // replace it with receiver mail id
$this->email->subject("Invoice"); // replace it with relevant subject
$body = $this->load->view('buyer/invoice',$data,TRUE);
$this->email->message($body);
$this->email->send();
And I used $data['content'] in view file as
$content['first_name']
In view file I send some dynamic value that I want to send in email. But in mail it gives an error like given variable is not define.
So what should I have to do?