diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index d7f9628a..921a9f3d 100755 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -1658,7 +1658,7 @@ class MasterController extends AdminController $email_id = CLI::getOption('to') ? CLI::getOption('to') : $email_id; $res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message,'attachments' => $attachments,'common'=>$common]); echo "Inside the master controller"; - print_r($res); + print_r($res['data']['zepto_api']); } @@ -1669,10 +1669,11 @@ class MasterController extends AdminController ["filePath" => ROOTPATH."public/sample_excel/sample_inception.xls","fileName" => "sample_inception.xls"], ["filePath" => ROOTPATH."public/assets/images/login_bg.jpg","fileName" => "login_bg.jpg"] ]; - $email_id = 'srinivas.saravanan@venbainfotech.com'; + $email_id = 'hariharan@nhanceindia.in'; $common = ['mail_type'=>'test_mail_cli']; + $bcc = "vijayalakshmi@nhanceindia.in,vitvelz@gmail.com,velmurugan.s@venbainfotech.com,hariharan@nhanceindia.in,hariharan@jubiliant.in,srinivas.saravanan@venbainfotech.com"; // Send email and get response - $result = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message,'attachments' => $attachments,'common'=>$common]); + $result = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI','bcc'=>$bcc ,'message' => $message,'attachments' => $attachments,'common'=>$common]); log_message('error',json_encode($result)); diff --git a/app/Helpers/ExcelSanitizeHelper.php b/app/Helpers/ExcelSanitizeHelper.php index b4950b34..67aaa55e 100644 --- a/app/Helpers/ExcelSanitizeHelper.php +++ b/app/Helpers/ExcelSanitizeHelper.php @@ -15,7 +15,7 @@ class ExcelSanitizeHelper "\x0A", "\x0B", "\x0C", "\x0D", "\x0E", "\x0F", "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1A", "\x1B", "\x1C", "\x1D", "\x1E", "\x1F", "\x7F", "_x000D_", "_x000A_", "_x0009_", "_x0008_", "_x0007_", - "_x0006_", "_x0005_", "_x0004_", "_x0003_", "_x0002_", "_x0001_" + "_x0006_", "_x0005_", "_x0004_", "_x0003_", "_x0002_", "_x0001_","\u200C" ]; /** diff --git a/app/Helpers/MailHelper.php b/app/Helpers/MailHelper.php index c55c2796..99490bde 100755 --- a/app/Helpers/MailHelper.php +++ b/app/Helpers/MailHelper.php @@ -325,31 +325,42 @@ class MailHelper // Add CC recipients if provided if (!empty($cc)) { - $postData['cc'] = []; - // Handle both string and array inputs for CC - $ccEmails = is_array($cc) ? $cc : [$cc]; - foreach ($ccEmails as $ccEmail) { - $postData['cc'][] = [ + $ccList = explode(',', $cc); + $ccList = array_map('trim', $ccList); + $postData['cc'] = array_map(function($email) { + return [ 'email_address' => [ - 'address' => $ccEmail + 'address' => $email ] ]; - } + }, $ccList); + } + // Add BCC if present + if (!empty($bcc)) { + $bccList = explode(',', $bcc); + $bccList = array_map('trim', $bccList); + $postData['bcc'] = array_map(function($email) { + return [ + 'email_address' => [ + 'address' => $email + ] + ]; + }, $bccList); } // Add BCC recipients if provided - if (!empty($bcc)) { - $postData['bcc'] = []; - // Handle both string and array inputs for BCC - $bccEmails = is_array($bcc) ? $bcc : [$bcc]; - foreach ($bccEmails as $bccEmail) { - $postData['bcc'][] = [ - 'email_address' => [ - 'address' => $bccEmail - ] - ]; - } - } + // if (!empty($bcc)) { + // $postData['bcc'] = []; + // // Handle both string and array inputs for BCC + // $bccEmails = is_array($bcc) ? $bcc : [$bcc]; + // foreach ($bccEmails as $bccEmail) { + // $postData['bcc'][] = [ + // 'email_address' => [ + // 'address' => $bccEmail + // ] + // ]; + // } + // } // Handle attachments if (!empty($attachments)) { diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index fa415c34..e8f0dd11 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -671,61 +671,98 @@ -