From 27032ec84c3ccda8544a3db73a9fc6b285f054bd Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Mon, 25 Nov 2019 12:30:29 +0530 Subject: [PATCH] CLIX NA2NOTPROVIDED MAIL DYNAMIC SUBJECT --- api/application/helpers/pdalerts_helper.php | 45 ++++++++++++++++++- .../report_templates/JSONTOREPORT_CLIX.php | 12 ++--- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 0fa3dca1..3ff3412e 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -478,8 +478,7 @@ class PDALERTS $fromName = 'PD Genie'; if(ENVIRONMENT == 'testing' || ENVIRONMENT == 'development') { $fromName .= ' ( TEST ENV ) '; } $mail->FromName = $fromName; $mail->isHTML(true); // Set email format to HTML - $mail->Subject = 'PD Report For Application ID -'.$core_details[0]['lender_applicant_id']; - if(ENVIRONMENT == 'testing' || ENVIRONMENT == 'development') { $mail->Subject .= ' ( TEST ENV ) '; } + $mail->Subject = SELF::subGenerator($core_details); $mail->Body = $msg; $mail->AltBody = $msg; @@ -492,6 +491,48 @@ class PDALERTS $logger->info("Mailer Send:" ,array('mail_ID' => $lender_email,'Status' => 'SEND')); } } + + + public static function subGenerator($core_details) + { + $status = $core_details[0]['pd_status']; + $dynamic = ''; + + switch($status) + { + case 'TRIGGERED': + $dynamic = 'Triggered'; + break; + + case 'ACCEPTED':$dynamic = 'Accepted'; + break; + + case 'BOUNCED':$dynamic = 'Bounced'; + break; + + case 'ALLOCATED':$dynamic = 'Allocated'; + break; + + case 'SCHEDULED':$dynamic = 'Scheduled'; + break; + + case 'STARTED':$dynamic = 'Started'; + break; + + case 'COMPLETED':$dynamic = 'Completed'; + break; + + case 'QC_COMPLETED':$dynamic = 'QC Completed'; + break; + + case 'CANCELLED':$dynamic = 'Cancelled'; + break; + + default: $dynamic = 'Status Update'; + } + $subject = 'PD '.$dynamic .' For Application ID -'.$core_details[0]['lender_applicant_id']; + return ENVIRONMENT == 'testing' || ENVIRONMENT == 'development' ? $subject .= ' ( TEST ENV ) ' : $subject; + } } diff --git a/api/application/views/report_templates/JSONTOREPORT_CLIX.php b/api/application/views/report_templates/JSONTOREPORT_CLIX.php index 72f1a9cf..340ac16f 100644 --- a/api/application/views/report_templates/JSONTOREPORT_CLIX.php +++ b/api/application/views/report_templates/JSONTOREPORT_CLIX.php @@ -2544,7 +2544,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $client_seventh_row .= $main_raw_material['manufacturing_credit_days_from'] && $main_raw_material['manufacturing_credit_days_to'] ? ''. $main_raw_material['manufacturing_credit_days_from'].' to '. $main_raw_material['manufacturing_credit_days_to'].' days'.'' :' NA ' ; - $client_eigth_row .= isset($main_raw_material['manufacturing_contribution_total_turnover']) && $main_raw_material['manufacturing_contribution_total_turnover'] != "" ? ''. $main_raw_material['manufacturing_contribution_total_turnover'].'' :' NA ' ; + $client_eigth_row .= isset($main_raw_material['manufacturing_contribution_total_turnover']) && $main_raw_material['manufacturing_contribution_total_turnover'] != "" ? ''. $main_raw_material['manufacturing_contribution_total_turnover'].'' :' Not Provided ' ; } @@ -2592,7 +2592,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $client_seventh_row .= $trading_product['trade_product_credit_days_from'] && $trading_product['trade_product_credit_days_to']? ''. $trading_product['trade_product_credit_days_from'].' to '. $trading_product['trade_product_credit_days_to'].' days'.'' :' NA ' ; - $client_eigth_row .= isset($trading_product['trade_product_contribution_total_turnover']) && $trading_product['trade_product_contribution_total_turnover'] != "" ? ''. $trading_product['trade_product_contribution_total_turnover'].'' :' NA ' ; + $client_eigth_row .= isset($trading_product['trade_product_contribution_total_turnover']) && $trading_product['trade_product_contribution_total_turnover'] != "" ? ''. $trading_product['trade_product_contribution_total_turnover'].'' :' Not Provided ' ; } @@ -2642,7 +2642,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $client_seventh_row .= $service_product['service_provider_product_credit_days_from'] && $service_product['service_provider_product_credit_days_to']? ''. $service_product['service_provider_product_credit_days_from'].' to '. $service_product['service_provider_product_credit_days_to'].' days'.'' :' NA ' ; - $client_eigth_row .= isset($service_product['service_provider_contribution_total_turnover']) && $service_product['service_provider_contribution_total_turnover'] != "" ? ''. $service_product['service_provider_contribution_total_turnover'].'' :' NA ' ; + $client_eigth_row .= isset($service_product['service_provider_contribution_total_turnover']) && $service_product['service_provider_contribution_total_turnover'] != "" ? ''. $service_product['service_provider_contribution_total_turnover'].'' :' Not Provided ' ; } } @@ -2877,7 +2877,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $supplier_seventh_row .= $raw['manufacturing_credit_days_from'] && $raw['manufacturing_credit_days_to'] ? ''. $raw['manufacturing_credit_days_from'].' to '. $raw['manufacturing_credit_days_to'].' days' : 'NA'; //array_push($supplierResult,$temp); - $supplier_eigth_row .= isset($raw['manufacturing_contribution_total_purchase']) && $raw['manufacturing_contribution_total_purchase'] != "" ? ''.$raw['manufacturing_contribution_total_purchase'] .'' : ' NA ' ; + $supplier_eigth_row .= isset($raw['manufacturing_contribution_total_purchase']) && $raw['manufacturing_contribution_total_purchase'] != "" ? ''.$raw['manufacturing_contribution_total_purchase'] .'' : ' Not Provided ' ; } } @@ -2923,7 +2923,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $supplier_seventh_row .= $tradeRow['trade_product_credit_days_from'] && $tradeRow['trade_product_credit_days_to'] ? ''. $tradeRow['trade_product_credit_days_from'].' to '. $tradeRow['trade_product_credit_days_to'].' days' : 'NA'; - $supplier_eigth_row .= isset($tradeRow['trade_product_contribution_total_purchase']) && $tradeRow['trade_product_contribution_total_purchase'] != "" ? ''.$tradeRow['trade_product_contribution_total_purchase'] .'' : ' NA ' ; + $supplier_eigth_row .= isset($tradeRow['trade_product_contribution_total_purchase']) && $tradeRow['trade_product_contribution_total_purchase'] != "" ? ''.$tradeRow['trade_product_contribution_total_purchase'] .'' : ' Not Provided ' ; ///array_push($supplierResult,$temp); //} @@ -2969,7 +2969,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $supplier_seventh_row .= $serviceRow['service_provider_credit_days_from'] && $serviceRow['service_provider_credit_days_to'] ? ''. $serviceRow['service_provider_credit_days_from'].' to '. $serviceRow['service_provider_credit_days_to'].' days' : 'NA'; - $supplier_eigth_row .= isset($serviceRow['service_provider_contribution_total_purchase']) && $serviceRow['service_provider_contribution_total_purchase'] != "" ? ''.$serviceRow['service_provider_contribution_total_purchase'] .'' : ' NA ' ; + $supplier_eigth_row .= isset($serviceRow['service_provider_contribution_total_purchase']) && $serviceRow['service_provider_contribution_total_purchase'] != "" ? ''.$serviceRow['service_provider_contribution_total_purchase'] .'' : ' Not Provided ' ; //array_push($supplierResult,$temp); //}