State added In mail : ps
This commit is contained in:
parent
3ed1727070
commit
f958c4f89c
@ -681,10 +681,16 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
log_message('ERROR','####SALESPD AFTER 10 PREPARED REPORT'.$records['sales_pd_id']);
|
||||
//echo 'afetr 10';
|
||||
//trigger mail function
|
||||
$s1 = $this->Sales_PD_Model->getState($records['sales_pd_id']);
|
||||
$questions = json_decode($s1[0]['section_data'],true);
|
||||
$Qdata = $this->processSalesPDQuestions($questions['questions'],1);
|
||||
$state = '';if(!empty($Qdata)){$state = $Qdata['state'];}
|
||||
$state = '';
|
||||
$form = $this->Sales_PD_Model->selectCustomRecords(array(),array('isactive' => 1,'sales_pd_id' => $records['sales_pd_id'],'section_id' => 1,'status' => 1),SALESPD_SECTION_DATA);
|
||||
$gen_form = json_decode($form[0]['section_data'],true);
|
||||
foreach ($gen_form['questions'] as $g_key => $g_value)
|
||||
{
|
||||
if($g_value['question_key'] == 'state')
|
||||
{
|
||||
$state = $g_value['answer_value'];
|
||||
}
|
||||
}
|
||||
PDALERTS::sendSalesPDMail($this,$records['sales_pd_id'],$state);
|
||||
}
|
||||
|
||||
|
||||
@ -540,14 +540,14 @@ class PDALERTS
|
||||
$mail->Password = "noreply@ssa"; // "The password"
|
||||
$mail->Port = 465; // "The port"
|
||||
$mail_id = 'ssa@venbainfotech.com';
|
||||
if(ENVIRONMENT == 'testing' && $state == "Delhi"){ $mail->addBCC("venkiraj0@gmail.com");}
|
||||
if(ENVIRONMENT == 'testing' && $state == 5){ $mail->addBCC("venkiraj0@gmail.com");}
|
||||
if(ENVIRONMENT == 'production')
|
||||
{
|
||||
$mail_id = 'cpa@smcfinance.com';
|
||||
$mail->addBCC("neville@sinemanagement.com");
|
||||
$mail->addBCC("ssa@venbainfotech.com");
|
||||
$mail->addAddress('cpumumbai@smcfinance.com');
|
||||
if($state == "Delhi"){ $mail->addBCC("satendersingh@smcfinance.com");}
|
||||
if($state == 5){ $mail->addBCC("satendersingh@smcfinance.com");}
|
||||
//$mail->addBCC("vitvelz@gmail.com");
|
||||
} // Name is optional }
|
||||
$mail->addAddress($mail_id);
|
||||
|
||||
@ -80,15 +80,6 @@ class Sales_PD_Model extends SPARQ_Model {
|
||||
//echo $this->db->last_query();die();
|
||||
return $result;
|
||||
}
|
||||
public function getState($sales_pd_id){
|
||||
$this->db->SELECT('section_data');
|
||||
$this->db->FROM('t_salespd_section_data');
|
||||
$this->db->WHERE('sales_pd_id',$sales_pd_id);
|
||||
$this->db->WHERE('isactive',1);
|
||||
$this->db->WHERE('section_id',1);
|
||||
$result = $this->db->get()->result_array();
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user