From 76c2b830b897e462260d9533caa43af2ae4ccefb Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Sat, 5 Oct 2019 17:15:57 +0530 Subject: [PATCH] MAIL SEND BASED ON ENV AND TWO HARD CODED --- api/application/helpers/pdalerts_helper.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 2da6ed17..c22837db 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -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;