SMC Vendor AutoMail : ps
This commit is contained in:
parent
289d51003a
commit
68b6e594f4
@ -1654,7 +1654,7 @@ public function assignPDTempalate($data)
|
|||||||
$records['vendor_status'] = isset($records['pd_status']) ? $records['pd_status'] : ALLOCATED ; //Here vendor_status is dynamic (ALLOCATED,SCHEDULED,COMPLETED like that)
|
$records['vendor_status'] = isset($records['pd_status']) ? $records['pd_status'] : ALLOCATED ; //Here vendor_status is dynamic (ALLOCATED,SCHEDULED,COMPLETED like that)
|
||||||
//Mail - SMC Vendor.
|
//Mail - SMC Vendor.
|
||||||
if($records['vendor_status'] == ALLOCATED){
|
if($records['vendor_status'] == ALLOCATED){
|
||||||
PDALERTS::sendMWcreditPDMail($this,$records['pd_id']);
|
PDALERTS::sendMWcreditPDMail($this,$records['pd_id'],2);
|
||||||
$records['pd_status'] = ALLOCATED_TO_FIA;
|
$records['pd_status'] = ALLOCATED_TO_FIA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -11294,13 +11294,12 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
|||||||
{
|
{
|
||||||
$pd_details['pd_status'] = ALLOCATED_TO_FIA;
|
$pd_details['pd_status'] = ALLOCATED_TO_FIA;
|
||||||
$pd_details['vendor_status'] = ALLOCATED;
|
$pd_details['vendor_status'] = ALLOCATED;
|
||||||
PDALERTS::sendMWcreditPDMail($this,$pd_details['pd_id']);
|
PDALERTS::sendMWcreditPDMail($this,$pd_details['pd_id'],1);
|
||||||
}
|
}
|
||||||
else if(count($regional_credit_manager))
|
else if(count($regional_credit_manager))
|
||||||
{
|
{
|
||||||
$pd_details['fk_pd_allocated_to'] = $regional_credit_manager[0]['userid'];
|
$pd_details['fk_pd_allocated_to'] = $regional_credit_manager[0]['userid'];
|
||||||
$pd_details['pd_status'] = ALLOCATED;
|
$pd_details['pd_status'] = ALLOCATED;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -691,7 +691,7 @@ class PDALERTS
|
|||||||
//echo $d;
|
//echo $d;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function sendMWcreditPDMail($CI,$pd_id)
|
public static function sendMWcreditPDMail($CI,$pd_id,$flag)
|
||||||
{
|
{
|
||||||
// $pd_id = $arr['pd_id'];
|
// $pd_id = $arr['pd_id'];
|
||||||
if($pd_id != "" || $pd_id != null)
|
if($pd_id != "" || $pd_id != null)
|
||||||
@ -721,19 +721,19 @@ class PDALERTS
|
|||||||
if(count($core_details))
|
if(count($core_details))
|
||||||
{
|
{
|
||||||
$mail = $CI->phpmailer_library->load();
|
$mail = $CI->phpmailer_library->load();
|
||||||
// $content = "Hi Sir/Mam".$pd_data[0]['officer_name'].",<br><br>MW-credit PD (".$pd_data[0]['officer_name'].") is Allocated to You";
|
if($flag == 2){
|
||||||
$CI->db->SELECT("*");
|
// Allocated to Agency
|
||||||
$CI->db->FROM(PDNOTIFICATIONMSG." as PDNOTIFICATIONMSG");
|
$mail_id = $core_details[0]['agency_mail'];
|
||||||
$CI->db->WHERE("PDNOTIFICATIONMSG.pd_status",ALLOCATED);
|
$msg = "PD for Loan Application ID-".$core_details[0]['pd_sno']." (".$core_details[0]['lender_applicant_id'] ." ".$core_details[0]['short_name'].") have been triggered to the vendor. ";
|
||||||
$CI->db->WHERE("PDNOTIFICATIONMSG.isactive",1);
|
$subject = "PD allocated to vendor for application ID - ".$core_details[0]['pd_sno'] ." & ". $core_details[0]['lender_applicant_id'] ." ".$core_details[0]['short_name'];
|
||||||
$pd_notification_msg = $CI->db->GET()->result_array();
|
}else if($flag == 1){
|
||||||
// print_r($pd_notification_msg);die();
|
// Allocated by CM/RCM
|
||||||
$msg = $pd_notification_msg[0]['lender'];
|
$mail_id = $core_details[0]['allocated_email'];
|
||||||
$msg = self::stringReplace($msg,$core_details,'MAIL');
|
$msg = "PD for Loan Application ID -".$core_details[0]['pd_sno'] ." & ". $core_details[0]['lender_applicant_id'] ." ".$core_details[0]['short_name']." have been triggered to the vendor.";
|
||||||
|
$subject = "PD allocated for application ID - ".$core_details[0]['pd_sno'] ." & ". $core_details[0]['lender_applicant_id'] ." ".$core_details[0]['short_name'];
|
||||||
|
}
|
||||||
|
|
||||||
$mail->IsSMTP(); // Telling the class to use SMTP
|
$mail->IsSMTP(); // Telling the class to use SMTP
|
||||||
$mail_id1 = $core_details[0]['allocated_email'];
|
|
||||||
$mail_id2 = $core_details[0]['agency_mail'];
|
|
||||||
$mail->SMTPAuth = true;
|
$mail->SMTPAuth = true;
|
||||||
$mail->SMTPDebug = 0;
|
$mail->SMTPDebug = 0;
|
||||||
$mail->SMTPSecure = "ssl";
|
$mail->SMTPSecure = "ssl";
|
||||||
@ -743,18 +743,15 @@ class PDALERTS
|
|||||||
$mail->Port = 465; // "The port"
|
$mail->Port = 465; // "The port"
|
||||||
$mail->From = 'noreply@pdgenie.com';
|
$mail->From = 'noreply@pdgenie.com';
|
||||||
$fromName = 'PD Genie';
|
$fromName = 'PD Genie';
|
||||||
$subject = 'PD Allocated For Application ID -'.$core_details[0]['lender_applicant_id'];
|
$mail->addAddress($mail_id);
|
||||||
$mail->addAddress($mail_id1);
|
|
||||||
$mail->addBCC($mail_id2);
|
|
||||||
if(ENVIRONMENT == 'testing' || ENVIRONMENT == 'development') {
|
if(ENVIRONMENT == 'testing' || ENVIRONMENT == 'development') {
|
||||||
$fromName .= ' ( TEST ENV ) ';
|
$fromName .= ' ( TEST ENV ) ';
|
||||||
$subject .= ' ( TEST ENV ) ';
|
$subject .= ' ( TEST ENV ) ';
|
||||||
$mail->addBCC("venkiraj0@gmail.com");
|
|
||||||
}
|
}
|
||||||
$mail->FromName = $fromName;
|
$mail->FromName = $fromName;
|
||||||
$mail->isHTML(true);
|
$mail->isHTML(true);
|
||||||
$mail->Subject = $subject;
|
$mail->Subject = $subject;
|
||||||
$mail->Body = 'Dear Team<br><br> '.$msg;
|
$mail->Body = 'Dear Team ,<br><br> '.$msg;
|
||||||
$mail->AltBody = $msg;
|
$mail->AltBody = $msg;
|
||||||
if(!$mail->send()) {
|
if(!$mail->send()) {
|
||||||
// $logger->error("Mailer Error:" ,array($mail->ErrorInfo));
|
// $logger->error("Mailer Error:" ,array($mail->ErrorInfo));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user