From 28a274aeee133f0f4fb32b7223cca581e0a43727 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Sat, 25 Dec 2021 16:09:47 +0530 Subject: [PATCH] SMC Vandor mail Format 2: ps --- api/application/controllers/PD_Controller.php | 3 ++- api/application/helpers/pdalerts_helper.php | 23 ++++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index d91607ef..25e01f15 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1654,6 +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) //Mail - SMC Vendor. if($records['vendor_status'] == ALLOCATED){ + PDALERTS::sendMWcreditPDMail($this,$records['pd_id'],1);sleep(2); PDALERTS::sendMWcreditPDMail($this,$records['pd_id'],2); $records['pd_status'] = ALLOCATED_TO_FIA; } @@ -11294,7 +11295,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() { $pd_details['pd_status'] = ALLOCATED_TO_FIA; $pd_details['vendor_status'] = ALLOCATED; - PDALERTS::sendMWcreditPDMail($this,$pd_details['pd_id'],1); + PDALERTS::sendMWcreditPDMail($this,$pd_details['pd_id'],3); } else if(count($regional_credit_manager)) { diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 5c107234..56f40680 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -721,16 +721,26 @@ class PDALERTS if(count($core_details)) { $mail = $CI->phpmailer_library->load(); - if($flag == 2){ + if($flag == 1){ // Allocated to Agency $mail_id = $core_details[0]['agency_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 to vendor for application ID - ".$core_details[0]['pd_sno'] ." & ". $core_details[0]['lender_applicant_id'] ." ".$core_details[0]['short_name']; - }else if($flag == 1){ + $msg = "PD for Loan Application ID-".$core_details[0]['pd_sno']." (".$core_details[0]['lender_applicant_id'] ." ".$core_details[0]['applicant_name'].") have been triggered to the vendor. "; + $subject = "PD allocated to vendor for application ID - ".$core_details[0]['pd_sno'] ." & ". $core_details[0]['lender_applicant_id'] ." ".$core_details[0]['applicant_name']; + }else if($flag == 2){ // Allocated by CM/RCM $mail_id = $core_details[0]['allocated_email']; - $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']; + $msg = "PD for Loan Application ID -".$core_details[0]['pd_sno'] ." & ". $core_details[0]['lender_applicant_id'] ." ".$core_details[0]['applicant_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]['applicant_name']; + }else if($flag == 3){ + $mail_id = $core_details[0]['allocated_email']; + $CI->db->SELECT("*"); + $CI->db->FROM(PDNOTIFICATIONMSG." as PDNOTIFICATIONMSG"); + $CI->db->WHERE("PDNOTIFICATIONMSG.pd_status",ALLOCATED); + $CI->db->WHERE("PDNOTIFICATIONMSG.isactive",1); + $pd_notification_msg = $CI->db->GET()->result_array(); + $msg = $pd_notification_msg[0]['lender']; + $msg = self::stringReplace($msg,$core_details,'MAIL'); + $subject = "PD allocated for application ID - ".$core_details[0]['pd_sno'] ." & ". $core_details[0]['lender_applicant_id'] ." ".$core_details[0]['applicant_name']; } $mail->IsSMTP(); // Telling the class to use SMTP @@ -747,6 +757,7 @@ class PDALERTS if(ENVIRONMENT == 'testing' || ENVIRONMENT == 'development') { $fromName .= ' ( TEST ENV ) '; $subject .= ' ( TEST ENV ) '; + // $mail->addBCC("venbalap08@gmail.com"); } $mail->FromName = $fromName; $mail->isHTML(true);