File: /var/www/html/pmw24/pmw_live_testing/app/application/controllers/customer/Notification.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Notification extends MY_Controller {
public function __construct() {
parent::__construct();
//print_r($this->admin);die;
$this->load->model('customer/mnotification');
$this->load->library('session');
}
public function check_due_notification(){
$check_due_notification = $this->mnotification->check_due_notification();
return $check_due_notification;
}
public function read_notification(){
$notification_id = $this->input->post('notification_id');
$condition = array('id'=>$notification_id);
$upd_data['is_read'] = 1;
$this->mcommon->update('customer_notification',$condition,$upd_data);
$return_data = array('status'=>true);
echo json_encode($return_data);
}
private function sendMail($data){
$config['protocol'] = 'smtp';
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://mail.fitser.com';
$config['smtp_port'] = '465';
$config['smtp_user'] = 'test123@fitser.com';
$config['smtp_pass'] = 'Test123@';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
$config['mailtype'] = 'html';
$config['validation'] = TRUE;
$this->email->initialize($config);
$this->email->set_crlf( "\r\n" );
$this->email->from('info@punjabmotor.com', 'PUNJAB MOTOR WORKSHOP');
$this->email->to($data['to']);
$this->email->subject($data['subject']);
$this->email->message($data['message']);
$this->email->send();
return true;
}
}