CLIX NA2NOTPROVIDED MAIL DYNAMIC SUBJECT

This commit is contained in:
Velz2020 2019-11-25 12:30:29 +05:30
parent 68780b8e42
commit 27032ec84c
2 changed files with 49 additions and 8 deletions

View File

@ -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;
}
}

View File

@ -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'] ? '<td class="customtd">'. $main_raw_material['manufacturing_credit_days_from'].' to '. $main_raw_material['manufacturing_credit_days_to'].' days'.'</td>' :'<td class="customtd"> NA </td>' ;
$client_eigth_row .= isset($main_raw_material['manufacturing_contribution_total_turnover']) && $main_raw_material['manufacturing_contribution_total_turnover'] != "" ? '<td class="customtd">'. $main_raw_material['manufacturing_contribution_total_turnover'].'</td>' :'<td class="customtd"> NA </td>' ;
$client_eigth_row .= isset($main_raw_material['manufacturing_contribution_total_turnover']) && $main_raw_material['manufacturing_contribution_total_turnover'] != "" ? '<td class="customtd">'. $main_raw_material['manufacturing_contribution_total_turnover'].'</td>' :'<td class="customtd"> Not Provided </td>' ;
}
@ -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']? '<td class="customtd">'. $trading_product['trade_product_credit_days_from'].' to '. $trading_product['trade_product_credit_days_to'].' days'.'</td>' :'<td class="customtd"> NA </td>' ;
$client_eigth_row .= isset($trading_product['trade_product_contribution_total_turnover']) && $trading_product['trade_product_contribution_total_turnover'] != "" ? '<td class="customtd">'. $trading_product['trade_product_contribution_total_turnover'].'</td>' :'<td class="customtd"> NA </td>' ;
$client_eigth_row .= isset($trading_product['trade_product_contribution_total_turnover']) && $trading_product['trade_product_contribution_total_turnover'] != "" ? '<td class="customtd">'. $trading_product['trade_product_contribution_total_turnover'].'</td>' :'<td class="customtd"> Not Provided </td>' ;
}
@ -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']? '<td class="customtd">'. $service_product['service_provider_product_credit_days_from'].' to '. $service_product['service_provider_product_credit_days_to'].' days'.'</td>' :'<td class="customtd"> NA </td>' ;
$client_eigth_row .= isset($service_product['service_provider_contribution_total_turnover']) && $service_product['service_provider_contribution_total_turnover'] != "" ? '<td class="customtd">'. $service_product['service_provider_contribution_total_turnover'].'</td>' :'<td class="customtd"> NA </td>' ;
$client_eigth_row .= isset($service_product['service_provider_contribution_total_turnover']) && $service_product['service_provider_contribution_total_turnover'] != "" ? '<td class="customtd">'. $service_product['service_provider_contribution_total_turnover'].'</td>' :'<td class="customtd"> Not Provided </td>' ;
}
}
@ -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'] ? '<td class="customtd">'. $raw['manufacturing_credit_days_from'].' to '. $raw['manufacturing_credit_days_to'].' days</td>' : '<td class="customtd">NA</td>';
//array_push($supplierResult,$temp);
$supplier_eigth_row .= isset($raw['manufacturing_contribution_total_purchase']) && $raw['manufacturing_contribution_total_purchase'] != "" ? '<td class="customtd">'.$raw['manufacturing_contribution_total_purchase'] .'</td>' : '<td class="customtd"> NA </td>' ;
$supplier_eigth_row .= isset($raw['manufacturing_contribution_total_purchase']) && $raw['manufacturing_contribution_total_purchase'] != "" ? '<td class="customtd">'.$raw['manufacturing_contribution_total_purchase'] .'</td>' : '<td class="customtd"> Not Provided </td>' ;
}
}
@ -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'] ? '<td class="customtd">'. $tradeRow['trade_product_credit_days_from'].' to '. $tradeRow['trade_product_credit_days_to'].' days</td>' : '<td class="customtd">NA</td>';
$supplier_eigth_row .= isset($tradeRow['trade_product_contribution_total_purchase']) && $tradeRow['trade_product_contribution_total_purchase'] != "" ? '<td class="customtd">'.$tradeRow['trade_product_contribution_total_purchase'] .'</td>' : '<td class="customtd"> NA </td>' ;
$supplier_eigth_row .= isset($tradeRow['trade_product_contribution_total_purchase']) && $tradeRow['trade_product_contribution_total_purchase'] != "" ? '<td class="customtd">'.$tradeRow['trade_product_contribution_total_purchase'] .'</td>' : '<td class="customtd"> Not Provided </td>' ;
///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'] ? '<td class="customtd">'. $serviceRow['service_provider_credit_days_from'].' to '. $serviceRow['service_provider_credit_days_to'].' days</td>' : '<td class="customtd">NA</td>';
$supplier_eigth_row .= isset($serviceRow['service_provider_contribution_total_purchase']) && $serviceRow['service_provider_contribution_total_purchase'] != "" ? '<td class="customtd">'.$serviceRow['service_provider_contribution_total_purchase'] .'</td>' : '<td class="customtd"> NA </td>' ;
$supplier_eigth_row .= isset($serviceRow['service_provider_contribution_total_purchase']) && $serviceRow['service_provider_contribution_total_purchase'] != "" ? '<td class="customtd">'.$serviceRow['service_provider_contribution_total_purchase'] .'</td>' : '<td class="customtd"> Not Provided </td>' ;
//array_push($supplierResult,$temp);
//}