MAIL SEND BASED ON ENV AND TWO HARD CODED

This commit is contained in:
Velz2020 2019-10-05 17:15:57 +05:30
parent 7cb5691db8
commit 76c2b830b8

View File

@ -17,6 +17,8 @@ class PDALERTS
public static function pdnotification($pdid)
{
if($pdid != "" || $pdid != null)
{
//echo $pdid;
@ -168,9 +170,14 @@ class PDALERTS
// self::sendMail($CI,$lender_email,$msg,$core_details); // currently Mail disabled
}
if($lender_sales_person_email != null){ self::sendMail($CI,$lender_sales_person_email,$msg,$core_details); }
if($lender_credit_person_email != null){ self::sendMail($CI,$lender_credit_person_email,$msg,$core_details); }
if($financial_institude_email != null){ self::sendMail($CI,$financial_institude_email,$msg,$core_details); }// currently Mail disabled
if(ENVIRONMENT == 'production')
{
if($lender_sales_person_email != null){ self::sendMail($CI,$lender_sales_person_email,$msg,$core_details); }
if($lender_credit_person_email != null){ self::sendMail($CI,$lender_credit_person_email,$msg,$core_details); }
if($financial_institude_email != null){ self::sendMail($CI,$financial_institude_email,$msg,$core_details); }
}
self::sendMail($CI,'komalmittal@sinemanagement.com',$msg,$core_details);
self::sendMail($CI,'sinepd@sinemanagement.com',$msg,$core_details);
}
// echo 'afer len mail';
@ -435,9 +442,10 @@ class PDALERTS
$mail->Username = "noreply@ssa.sineedge.com"; // "The account"
$mail->Password = "noreply@ssa"; // "The password"
$mail->Port = 465; // "The port"
$mail->addAddress($lender_email); // Name is optional
$mail->From = 'noreply@ssa.sineedge.com';
$mail->FromName = 'SineEdge QC Team';
$mail->addAddress($lender_email); // Name is optional
$mail->From = 'noreply@pdgenie.com';
$fromName = 'SineEdge QC Team'; 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'];
$mail->Body = $msg;