HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
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;   	
    } 

}