File: //var/www/html/pmw24/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['smtp_host'] = 'ssl://smtp.gmail.com'; //'ssl://smtp.gmail.com';
$config['smtp_port'] = '465';
$config['smtp_user'] = 'info@pmw24.com.au'; //'joysz2018@gmail'
$config['smtp_pass'] = 'kzlsdsxnsoevymxi';//'poker#2018';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
$config['mailtype'] = 'html';
$config['validation'] = TRUE;
$this->load->library('email');
$this->email->initialize($config);
$this->email->set_crlf( "\r\n" );
$this->email->from('info@pmw24.com.au', 'Punjab Motor Work Shop');
//$data['to']
$this->email->to($data['to']);
//$this->email->bcc('ishani.banerjee@met-technologies.com', 'Dev');
$this->email->subject($data['subject']);
$this->email->message($data['message']);
$this->email->send();
return true;
}
}