From 51c67f07c972c75fa750dd01ec26846e81e39412 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Tue, 16 Sep 2025 16:32:44 +0530 Subject: [PATCH 01/17] CHANGE_Fixing_logo_in_clients by vadivel --- app/Config/Routes.php | 2 +- app/Controllers/NotificationController.php | 17 ++++++++++ app/Helpers/sendMailNotification.php | 36 ++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 4a21b1c..75c60b5 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -514,5 +514,5 @@ $routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy"); $routes->post("addEmployeeAndDependence", "EmployeeRestController::addEmployeeAndDependence"); $routes->post("getPreEmployeePolicyCount", "EmployeeRestController::getPreEmployeePolicyCount"); - +$routes->get('notification_mail_header',"NotificationController::notification_mail_header"); diff --git a/app/Controllers/NotificationController.php b/app/Controllers/NotificationController.php index a3d6679..6812df2 100755 --- a/app/Controllers/NotificationController.php +++ b/app/Controllers/NotificationController.php @@ -280,4 +280,21 @@ class NotificationController extends AdminController } } + public function notification_mail_header(){ + + $params = []; + $params['client_data'] = $this->clientModel->where('id', 12)->first(); + + return view('notification_mail_header',$params); + } + + + + + + + + + + } \ No newline at end of file diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index 743ca23..ec13519 100755 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -57,6 +57,8 @@ class sendMailNotification $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); if ($dataToInsert['relationship'] == 'Self' && $mail != null || $mail != '') { + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'attachments' => $attachments, 'common' => $common]; } @@ -89,6 +91,9 @@ class sendMailNotification $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $employee_mobile_no, $mail_content); $mail = $emp_data['email_corporate']; + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; return $wholeData; @@ -139,6 +144,9 @@ class sendMailNotification $mail_content = str_replace(["[[ecard_download_link]]", "{{ecard_download_link}}"], "Download Insurance Card", $mail_content); $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; return $wholeData; @@ -161,6 +169,7 @@ class sendMailNotification $client_data =$clientModel->where('id', $client_id)->first(); $notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first(); + $params['client_data'] = $client_data; // dd($notification_data); if (isset($notification_data) && $notification_data['enabled'] == 1) { @@ -536,6 +545,9 @@ class sendMailNotification // print_r($mail_content); die; + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; + $wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; return $wholeData; @@ -557,6 +569,9 @@ class sendMailNotification $client_data =$clientModel->where('id', $client_id)->first(); + + $params['client_data'] = $client_data; + $notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first(); if (isset($notification_data) && $notification_data['enabled'] == 1) { @@ -833,6 +848,9 @@ class sendMailNotification $full_name = $value['first_name'] .' ' .$value['last_name']; $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $full_name , $mail_content); + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; + $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to'], 'common' => $common]; // $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'}}; } @@ -1132,6 +1150,8 @@ class sendMailNotification // $mail_array = array_map('trim', $mail_array); // $wholeData = []; // foreach ($mail_array as $key => $value) { + // $header_of_mail = view('notification_mail_header', $params); + // $mail_content = $header_of_mail . $mail_content ; // $wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to'], 'common' => $common]; // // $wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'}}; // } @@ -1191,6 +1211,10 @@ class sendMailNotification $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); if ($mail != null || $mail != '') { + + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'attachments' => $attachments]; } @@ -1223,6 +1247,8 @@ class sendMailNotification if ((isset($notification_data) && $notification_data['enabled'] == 1)) { if (isset($mail) && !empty($mail)) { + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; } @@ -1276,6 +1302,9 @@ class sendMailNotification $mail_content = str_replace(["[[ecard_download_link]]", "{{ecard_download_link}}"], "Download Insurance Card", $mail_content); $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'],'attachments' => $attachments, 'reply_to' => $client_data['reply_to']]; return $wholeData; @@ -1427,6 +1456,8 @@ class sendMailNotification $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $mobile, $mail_content); $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; @@ -1576,6 +1607,9 @@ class sendMailNotification $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')' , $mail_content); $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']]; return $wholeData; @@ -1725,6 +1759,8 @@ class sendMailNotification $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')' , $mail_content); $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); + $header_of_mail = view('notification_mail_header', $params); + $mail_content = $header_of_mail . $mail_content ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']]; From e33d179c6274fa97cc58c8755906895c22016658 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Tue, 16 Sep 2025 16:35:16 +0530 Subject: [PATCH 02/17] CHANGE_FIX_LOGO_FOR_CLIENTS --- app/Views/notification_mail_header.php | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 app/Views/notification_mail_header.php diff --git a/app/Views/notification_mail_header.php b/app/Views/notification_mail_header.php new file mode 100644 index 0000000..d27502d --- /dev/null +++ b/app/Views/notification_mail_header.php @@ -0,0 +1,30 @@ + + + + + + Email Notification + + + + + + + + + +
+ Client Logo + + Default Logo +
+ + + + + + \ No newline at end of file From e69442d495d86e786565f56fec31fe5df2928e8d Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Tue, 16 Sep 2025 17:10:24 +0530 Subject: [PATCH 03/17] CHANGE_logo_fix - VADIVEL J 2025-09-16 --- app/Views/notification_mail_header.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Views/notification_mail_header.php b/app/Views/notification_mail_header.php index d27502d..f2499d7 100644 --- a/app/Views/notification_mail_header.php +++ b/app/Views/notification_mail_header.php @@ -9,11 +9,11 @@ - +
- Client Logo + style="max-height:60px;"> Date: Tue, 16 Sep 2025 17:38:04 +0530 Subject: [PATCH 04/17] CHANGE_logo_fix_final - VADIVEL J 2025-09-16 --- app/Config/Routes.php | 5 +++++ app/Controllers/NotificationController.php | 1 + app/Helpers/sendMailNotification.php | 1 + app/Views/notification_mail_header.php | 1 + 4 files changed, 8 insertions(+) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 8258cf1..83145d5 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -519,5 +519,10 @@ $routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy"); $routes->post("addEmployeeAndDependence", "EmployeeRestController::addEmployeeAndDependence"); $routes->post("getPreEmployeePolicyCount", "EmployeeRestController::getPreEmployeePolicyCount"); + + +// notification mail template $routes->get('notification_mail_header',"NotificationController::notification_mail_header"); + + diff --git a/app/Controllers/NotificationController.php b/app/Controllers/NotificationController.php index 6812df2..99fe93d 100755 --- a/app/Controllers/NotificationController.php +++ b/app/Controllers/NotificationController.php @@ -280,6 +280,7 @@ class NotificationController extends AdminController } } + // This function for load the mail header in notification mail template public function notification_mail_header(){ $params = []; diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index 5624627..403de4a 100755 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -13,6 +13,7 @@ use App\Models\PolicyPremium2Model; use App\Models\MailAttachmentModel; use Kint\Kint; +// send mail notification class sendMailNotification { public static function sendMailNotification($action, $params) diff --git a/app/Views/notification_mail_header.php b/app/Views/notification_mail_header.php index f2499d7..daec224 100644 --- a/app/Views/notification_mail_header.php +++ b/app/Views/notification_mail_header.php @@ -25,6 +25,7 @@ + \ No newline at end of file From ef625e80349546e4351f29bc8827aaf82929b884 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Tue, 16 Sep 2025 18:19:38 +0530 Subject: [PATCH 05/17] CHANGE_logo_fix_final - VADIVEL J 2025-09-16 --- app/Views/notification_mail_header.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Views/notification_mail_header.php b/app/Views/notification_mail_header.php index daec224..501492f 100644 --- a/app/Views/notification_mail_header.php +++ b/app/Views/notification_mail_header.php @@ -7,11 +7,10 @@ - From 8a356d3af95de0e7012c2d4e27f4b3f4507f3b03 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 17 Sep 2025 11:06:46 +0530 Subject: [PATCH 06/17] CHANGE_logo_fix_final - VADIVEL J 2025-09-17 --- app/Config/Routes.php | 2 ++ app/Controllers/NotificationController.php | 9 +++++ app/Helpers/sendMailNotification.php | 38 +++++++++++++++------- app/Views/notification_mail_footer.php | 29 +++++++++++++++++ app/Views/notification_mail_header.php | 2 +- 5 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 app/Views/notification_mail_footer.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 83145d5..896ca58 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -524,5 +524,7 @@ $routes->post("getPreEmployeePolicyCount", "EmployeeRestController::getPreEmploy // notification mail template $routes->get('notification_mail_header',"NotificationController::notification_mail_header"); +$routes->get('notification_mail_footer',"NotificationController::notification_mail_footer"); + diff --git a/app/Controllers/NotificationController.php b/app/Controllers/NotificationController.php index 99fe93d..0c3890f 100755 --- a/app/Controllers/NotificationController.php +++ b/app/Controllers/NotificationController.php @@ -290,6 +290,15 @@ class NotificationController extends AdminController } + public function notification_mail_footer(){ + + $params = []; + $params['client_data'] = $this->clientModel->where('id', 12)->first(); + + return view('notification_mail_footer',$params); + } + + diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index 403de4a..624629c 100755 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -60,7 +60,10 @@ class sendMailNotification $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); if ($dataToInsert['relationship'] == 'Self' && $mail != null || $mail != '') { $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'attachments' => $attachments, 'common' => $common]; } @@ -94,7 +97,8 @@ class sendMailNotification $mail = $emp_data['email_corporate']; $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; @@ -147,7 +151,8 @@ class sendMailNotification $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; @@ -548,7 +553,8 @@ class sendMailNotification // print_r($mail_content); die; $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; $wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; @@ -851,7 +857,8 @@ class sendMailNotification $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $full_name , $mail_content); $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to'], 'common' => $common]; // $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'}}; @@ -1153,7 +1160,8 @@ class sendMailNotification // $wholeData = []; // foreach ($mail_array as $key => $value) { // $header_of_mail = view('notification_mail_header', $params); - // $mail_content = $header_of_mail . $mail_content ; + // $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; // $wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to'], 'common' => $common]; // // $wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'}}; // } @@ -1215,7 +1223,8 @@ class sendMailNotification if ($mail != null || $mail != '') { $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'attachments' => $attachments]; } @@ -1250,7 +1259,8 @@ class sendMailNotification if (isset($mail) && !empty($mail)) { $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; } @@ -1305,7 +1315,8 @@ class sendMailNotification $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'],'attachments' => $attachments, 'reply_to' => $client_data['reply_to']]; @@ -1459,7 +1470,8 @@ class sendMailNotification $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; @@ -1610,7 +1622,8 @@ class sendMailNotification $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']]; @@ -1762,7 +1775,8 @@ class sendMailNotification $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); $header_of_mail = view('notification_mail_header', $params); - $mail_content = $header_of_mail . $mail_content ; + $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']]; diff --git a/app/Views/notification_mail_footer.php b/app/Views/notification_mail_footer.php new file mode 100644 index 0000000..c9a990b --- /dev/null +++ b/app/Views/notification_mail_footer.php @@ -0,0 +1,29 @@ + + + + + + Email Notification + + + +
- Client Logo
+ + + +
+ Default Logo +

+ © Nhance India Insurance Broking Pvt Ltd +

+ +
+ + + + + + + \ No newline at end of file diff --git a/app/Views/notification_mail_header.php b/app/Views/notification_mail_header.php index 501492f..6a10b14 100644 --- a/app/Views/notification_mail_header.php +++ b/app/Views/notification_mail_header.php @@ -8,7 +8,7 @@ - +
Client Logo Date: Wed, 17 Sep 2025 11:44:59 +0530 Subject: [PATCH 07/17] CHANGE_logo_fix_final - VADIVEL J 2025-09-17 --- app/Views/notification_mail_footer.php | 26 +++++++++------- app/Views/notification_mail_header.php | 43 ++++++++++++++------------ 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/app/Views/notification_mail_footer.php b/app/Views/notification_mail_footer.php index c9a990b..1076a15 100644 --- a/app/Views/notification_mail_footer.php +++ b/app/Views/notification_mail_footer.php @@ -6,20 +6,22 @@ Email Notification +
+ + + - -
+ Default Logo +

+ © Nhance India Insurance Broking Pvt Ltd +

- - - + +
- Default Logo -

- © Nhance India Insurance Broking Pvt Ltd -

+
+ -
diff --git a/app/Views/notification_mail_header.php b/app/Views/notification_mail_header.php index 6a10b14..99b0afc 100644 --- a/app/Views/notification_mail_header.php +++ b/app/Views/notification_mail_header.php @@ -1,30 +1,35 @@ + - - - Email Notification + + + Email Notification + - - - - - - -
- Client Logo - - Default Logo -
+
+ + + + + +
+ Client Logo + + Default Logo +
+
+ + - + \ No newline at end of file From 54b9c2faa3d96a4f04fcd796e2387c335f2155dd Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 17 Sep 2025 11:50:36 +0530 Subject: [PATCH 08/17] CHANGE_logo_fix_final - VADIVEL J 2025-09-17 --- app/Views/notification_mail_footer.php | 2 +- app/Views/notification_mail_header.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Views/notification_mail_footer.php b/app/Views/notification_mail_footer.php index 1076a15..5c286bc 100644 --- a/app/Views/notification_mail_footer.php +++ b/app/Views/notification_mail_footer.php @@ -7,7 +7,7 @@
- +
- +
Date: Fri, 19 Sep 2025 15:34:24 +0530 Subject: [PATCH 09/17] CHANGE_Logo_fix_final_2 - VADIVEL J 2025-09-19 --- app/Helpers/sendMailNotification.php | 168 +++++++++++++++++++++++-- app/Views/notification_mail_footer.php | 2 +- app/Views/notification_mail_header.php | 2 +- 3 files changed, 158 insertions(+), 14 deletions(-) diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index 624629c..0d6c9bd 100755 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -62,7 +62,19 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'attachments' => $attachments, 'common' => $common]; } @@ -98,7 +110,19 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; @@ -152,7 +176,19 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; @@ -554,7 +590,19 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; @@ -858,7 +906,19 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to'], 'common' => $common]; // $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'}}; @@ -1161,7 +1221,19 @@ class sendMailNotification // foreach ($mail_array as $key => $value) { // $header_of_mail = view('notification_mail_header', $params); // $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + // $mail_content = $header_of_mail . + // '
+ // + + // + // + // + //
+ // ' . $mail_content . ' + //
+ //
' . $footer_of_mail; + // $wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to'], 'common' => $common]; // // $wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'}}; // } @@ -1224,7 +1296,19 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'attachments' => $attachments]; } @@ -1260,7 +1344,19 @@ class sendMailNotification if (isset($mail) && !empty($mail)) { $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; } @@ -1316,7 +1412,19 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'],'attachments' => $attachments, 'reply_to' => $client_data['reply_to']]; @@ -1471,7 +1579,19 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; @@ -1623,7 +1743,19 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']]; @@ -1776,7 +1908,19 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . $mail_content . $footer_of_mail ; + $mail_content = $header_of_mail . + '
+ + + + + +
+ ' . $mail_content . ' +
+
' . $footer_of_mail; + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']]; diff --git a/app/Views/notification_mail_footer.php b/app/Views/notification_mail_footer.php index 5c286bc..ca58d5f 100644 --- a/app/Views/notification_mail_footer.php +++ b/app/Views/notification_mail_footer.php @@ -7,7 +7,7 @@
- +
- +
Date: Fri, 19 Sep 2025 18:43:32 +0530 Subject: [PATCH 10/17] CHANGE_logo_fix_final_3 - VADIVEL J 2025-09-19 --- app/Views/notification_mail_footer.php | 4 ++-- app/Views/notification_mail_header.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Views/notification_mail_footer.php b/app/Views/notification_mail_footer.php index ca58d5f..3ccda22 100644 --- a/app/Views/notification_mail_footer.php +++ b/app/Views/notification_mail_footer.php @@ -7,8 +7,8 @@
- - +
+ '; // $temp_data .= ''; // $temp_data .= ''; @@ -1127,11 +1066,11 @@ class sendMailNotification // $temp_data .= ''; // $temp_data .= ''; // $temp_data .= ''; - + // $temp_data .= ''; - + // $is_addon = $inner_item['is_addon']; - + // $addtional_premium = $inner_item['rata_premimum'] + $addtional_premium; // $gst = $inner_item['gst'] + $gst; // } @@ -1140,10 +1079,10 @@ class sendMailNotification // if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){ // $policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents'; // } - + // $table_content .= $policy_name_for_policy_type . ' ( Payable By Employee ) '; // $table_content .= '
Default Logo
- - +
+ '; // $temp_data .= ''; // $temp_data .= ''; // $temp_data .= ''; // $temp_data .= ''; - + // // Only Display SI Topup and Dependent Addon // if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) { // $temp_data .= ''; // $temp_data .= ''; // } - + // $temp_data .= ''; - + // $is_addon = $inner_item['is_addon']; - + // if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) { // $addtional_premium = $inner_item['rata_premimum'] + $addtional_premium; // $gst = $inner_item['gst'] + $gst; // } // } - + // $policy_name_for_policy_type = $inner_item['policy_name']; // if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){ // $policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents'; @@ -1057,7 +996,7 @@ class sendMailNotification // $table_content .= $policy_name_for_policy_type . ''; // $table_content .= '
- Client Logo + style="max-height:60px; max-width: 160px;"> Date: Sat, 20 Sep 2025 09:50:28 +0530 Subject: [PATCH 11/17] CHANGE_logo_fix_final_4 - VADIVEL J 2025-09-20 --- app/Views/notification_mail_footer.php | 4 ++-- app/Views/notification_mail_header.php | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/Views/notification_mail_footer.php b/app/Views/notification_mail_footer.php index 3ccda22..883eeb3 100644 --- a/app/Views/notification_mail_footer.php +++ b/app/Views/notification_mail_footer.php @@ -7,8 +7,8 @@
- - +
+ '; $temp_data .= ''; $temp_data .= ''; @@ -809,23 +760,23 @@ class sendMailNotification $temp_data .= ''; $temp_data .= ''; $temp_data .= ''; - + $temp_data .= ''; - + $is_addon = $inner_item['is_addon']; - + $addtional_premium = $inner_item['rata_premimum'] + $addtional_premium; $gst = $inner_item['gst'] + $gst; } $policy_name_for_policy_type = $inner_item['policy_name']; - if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){ + if ($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3) { $policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents'; } - + $table_content .= $policy_name_for_policy_type . ' ( Payable By Employee ) '; $table_content .= '
Default Logo
- - +
+ @@ -24,12 +24,6 @@
- Client Logo
- - - - - - \ No newline at end of file From d6f785e5d2339af65cfcf27d495f6ecf7eaf4d2f Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 20 Sep 2025 10:04:20 +0530 Subject: [PATCH 12/17] CHANGE_logo_fix_final_4 - VADIVEL J 2025-09-20 --- app/Views/notification_mail_header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Views/notification_mail_header.php b/app/Views/notification_mail_header.php index 1adf2c4..6b86740 100644 --- a/app/Views/notification_mail_header.php +++ b/app/Views/notification_mail_header.php @@ -12,7 +12,7 @@ From 8cb36fb64f4f9f4b8453db8932e49b6ed4ff338e Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 20 Sep 2025 10:37:40 +0530 Subject: [PATCH 13/17] CHANGE_logo_fix_final_4 - VADIVEL J 2025-09-20 --- app/Helpers/sendMailNotification.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index 0d6c9bd..cd29027 100755 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -1300,9 +1300,8 @@ class sendMailNotification '
- Client Logo
- - From 78397a1d6d05f59bbf2d3264745a5a92f7e6beaa Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 20 Sep 2025 11:19:44 +0530 Subject: [PATCH 14/17] CHANGE_logo_fix_final_4 - VADIVEL J 2025-09-20 --- app/Views/notification_mail_header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Views/notification_mail_header.php b/app/Views/notification_mail_header.php index 6b86740..16a4647 100644 --- a/app/Views/notification_mail_header.php +++ b/app/Views/notification_mail_header.php @@ -12,7 +12,7 @@
+ ' . $mail_content . '
From 9e0261317e11fc7b9c34ec00eb86f7717d3dbb53 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 20 Sep 2025 12:47:27 +0530 Subject: [PATCH 15/17] CHANGE_logo_fix_final_4 - VADIVEL J 2025-09-20 --- app/Helpers/sendMailNotification.php | 38 +++++++++++++++++--------- app/Views/notification_mail_header.php | 4 +-- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index cd29027..2811d4a 100755 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -62,7 +62,8 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
- Client Logo
@@ -110,7 +111,8 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
@@ -176,7 +178,8 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
@@ -590,7 +593,8 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
@@ -906,7 +910,8 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
@@ -1221,7 +1226,8 @@ class sendMailNotification // foreach ($mail_array as $key => $value) { // $header_of_mail = view('notification_mail_header', $params); // $footer_of_mail = view('notification_mail_footer', $params); - // $mail_content = $header_of_mail . + // $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + // $mail_content = $header_of_mail . // '
//
@@ -1248,7 +1254,7 @@ class sendMailNotification { $wholeData =[]; - if ($action == 'member_welcome_mail') { + if ($action == 'member_welcome_mail'){ $clientModel = new ClientModel(); @@ -1296,7 +1302,8 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
@@ -1343,7 +1350,8 @@ class sendMailNotification if (isset($mail) && !empty($mail)) { $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
@@ -1411,7 +1419,8 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
@@ -1578,7 +1587,8 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
@@ -1742,7 +1752,8 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
@@ -1907,7 +1918,8 @@ class sendMailNotification $header_of_mail = view('notification_mail_header', $params); $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = $header_of_mail . + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + $mail_content = $header_of_mail . '
diff --git a/app/Views/notification_mail_header.php b/app/Views/notification_mail_header.php index 16a4647..7649920 100644 --- a/app/Views/notification_mail_header.php +++ b/app/Views/notification_mail_header.php @@ -10,11 +10,11 @@
- + '; $temp_data .= ''; $temp_data .= ''; $temp_data .= ''; $temp_data .= ''; - + // Only Display SI Topup and Dependent Addon if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) { $temp_data .= ''; $temp_data .= ''; } - + $temp_data .= ''; - + $is_addon = $inner_item['is_addon']; - + if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) { $addtional_premium = $inner_item['rata_premimum'] + $addtional_premium; $gst = $inner_item['gst'] + $gst; @@ -733,13 +684,13 @@ class sendMailNotification } $policy_name_for_policy_type = $inner_item['policy_name']; - if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){ + if ($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3) { $policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents'; } - + $table_content .= $policy_name_for_policy_type . ''; $table_content .= '
Client Logo + style="max-height:80px; max-width: 160px;"> Date: Sat, 20 Sep 2025 17:20:23 +0530 Subject: [PATCH 16/17] CHANGE_logo_fix_final_5 - VADIVEL J 2025-09-20 --- app/Views/notification_mail_footer.php | 21 ++++++++++++++++++++- app/Views/notification_mail_header.php | 24 +++++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/app/Views/notification_mail_footer.php b/app/Views/notification_mail_footer.php index 883eeb3..31515e5 100644 --- a/app/Views/notification_mail_footer.php +++ b/app/Views/notification_mail_footer.php @@ -5,9 +5,28 @@ Email Notification + + +
- +
'; $temp_data .= ''; $temp_data .= ''; $temp_data .= ''; - + // dd($si); // Premium summery for show and hide the Additional premium data - if($inner_item['payable_employee'] == 1 || $client_policy_data['is_premium_summery'] == 1){ - if($policy_premium_data['premium_type'] == 2){ + if ($inner_item['payable_employee'] == 1 || $client_policy_data['is_premium_summery'] == 1) { + if ($policy_premium_data['premium_type'] == 2) { $temp_data .= ''; $temp_data .= ''; $temp_data .= ''; + } else { - }else{ + if ($policy_premium_data['premium_type'] == 1) { - if($policy_premium_data['premium_type'] == 1){ + $temp_data .= (($si != 0 && count($item) != 1) ? ('') : ($si == 0 ? "" : '')); + $temp_data .= (($premium != 0 && count($item) != 1) ? ('') : ($premium == 0 ? "" : '')); + $temp_data .= (($gst_forself != 0 && count($item) != 1) ? ('') : ($gst_forself == 0 ? "" : '')); + } else { - $temp_data .= (($si != 0 && count($item) != 1) ? ('') : ($si == 0 ? "" : '') ); - $temp_data .= (($premium != 0 && count($item) != 1) ? ('') : ($premium == 0 ? "" : '') ); - $temp_data .= (($gst_forself != 0 && count($item) != 1) ? ('') : ($gst_forself == 0 ? "" : '') ); - - }else{ - - $temp_data .= (($si != 0 && count($item) != 1) ? ('') : ($si == 0 ? "" : '') ); + $temp_data .= (($si != 0 && count($item) != 1) ? ('') : ($si == 0 ? "" : '')); $temp_data .= ''; - $temp_data .= ''; + $temp_data .= ''; } $self_si_amount = 0; $self_premium = 0; $self_gst = 0; } - }else{ + } else { $temp_data .= ''; } - + $temp_data .= ''; - + $is_addon = $inner_item['is_addon']; - + $addtional_premium = $inner_item['rata_premimum'] + $addtional_premium; $gst = $inner_item['gst'] + $gst; } $policy_name_for_policy_type = $inner_item['policy_name']; - if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){ + if ($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3) { $policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents'; } - + $table_content .= $policy_name_for_policy_type . ' ( Payable By Employee ) '; $table_content .= ''; - + // Add text-align: center to the table head $table_content .= ''; $table_content .= ''; @@ -513,20 +478,20 @@ class sendMailNotification $table_content .= ''; // Premium summery for show and hide the Additional premium data - if($inner_item['payable_employee'] == 1 || $client_policy_data['is_premium_summery'] == 1){ + if ($inner_item['payable_employee'] == 1 || $client_policy_data['is_premium_summery'] == 1) { $table_content .= ''; $table_content .= ''; } - + $table_content .= ''; $table_content .= ''; - + // Add text-align: center to the table body $table_content .= '' . $temp_data . ''; $table_content .= '
Sum InsuredPremiumGST
'; - + // Premium summery for show and hide the Additional premium data - if($inner_item['payable_employee'] == 1 || $client_policy_data['is_premium_summery'] == 1){ + if ($inner_item['payable_employee'] == 1 || $client_policy_data['is_premium_summery'] == 1) { $addon_list_array = [ 'policy_name' => $policy_name_for_policy_type . '( Payable By Employee )', 'addtional_premium' => round($addtional_premium), @@ -535,18 +500,17 @@ class sendMailNotification $Addon_list[] = $addon_list_array; } - + $temp_data = ''; $addtional_premium = 0; $gst = 0; - } } - + if (count($Addon_list) > 0) { $table_content .= '
'; $table_content .= ''; - + // Center align for table header and body $table_content .= ''; $table_content .= ''; @@ -556,14 +520,14 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + $table_content .= ''; - + $sum_total = 0; foreach ($Addon_list as $key => $value) { $total_addon = $value['gst'] + $value['addtional_premium']; $sum_total += $total_addon; - + $table_content .= ''; $table_content .= ''; $table_content .= ''; @@ -571,7 +535,7 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; } - + $sum_total_words = numberToWords($sum_total); $table_content .= ''; $table_content .= ''; @@ -581,76 +545,63 @@ class sendMailNotification $table_content .= '
Total
' . $value['policy_name'] . '₹' . format_indian_number($value['addtional_premium']) . '₹' . format_indian_number($total_addon) . '
Total
'; // $table_content .= '
' . $sum_total_words . '
'; } - + // dd($payable_employee_array, $Addon_list); // print_r($table_content); die; - $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')' , $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')', $mail_content); $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $employee_mobile_no, $mail_content); - $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); - - // print_r($mail_content); die; - - $header_of_mail = view('notification_mail_header', $params); - $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content, $mail_content); + + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - $mail_content = $header_of_mail . - '
- - - - -
- ' . $mail_content . ' -
-
' . $footer_of_mail; + $data['params'] = $params; + $data['mail_content'] = $mail_content; + $mail_content = view('mail_template', $data); - $wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; + $wholeData[] = ['mail' => $mail, 'subject' => $subject, 'message' => $mail_content, 'bcc' => $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; return $wholeData; - } + } else if ($action == 'account_maneger_summary_mail') { - } else if($action == 'account_maneger_summary_mail'){ - $client_id = $params['client_id']; $client_policy_id = $params['client_policy_id']; $common = $params['common']; $clientModel = new ClientModel(); $notificationModel = new NotificationModel(); - $clientRMModel =new ClientRMModel(); + $clientRMModel = new ClientRMModel(); $clientPolicyModel = new ClientPolicyModel(); $PolicyPremium1Model = new PolicyPremium1Model(); $PolicyPremium2Model = new PolicyPremium2Model(); - $client_data =$clientModel->where('id', $client_id)->first(); + $client_data = $clientModel->where('id', $client_id)->first(); $params['client_data'] = $client_data; - $notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first(); + $notification_data = $notificationModel->where('client_id', $client_id)->where('template_name', $action)->first(); - if (isset($notification_data) && $notification_data['enabled'] == 1) { + if (isset($notification_data) && $notification_data['enabled'] == 1) { - $client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll(); - $user_list= []; + $client_rm_data = $clientRMModel->where('client_id', $client_id)->where('is_active', 1)->findAll(); + $user_list = []; foreach ($client_rm_data as $key => $value) { - if($value['level'] == 3){ + if ($value['level'] == 3) { $userModel = new UserModel(); $user_data = $userModel->where('id', $value['user_id'])->first(); - $user_list[]=$user_data; + $user_list[] = $user_data; } } - + $mail_content = $notification_data['mail_content']; $subject = $notification_data['subject']; $app_link = $_ENV['App_Url']; $nhance_logo = $_ENV['NHANCE_LOGO']; - + $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; // $client_logo = $nhance_logo; @@ -677,24 +628,24 @@ class sendMailNotification $temp_data = ''; $policy_name = ''; $is_addon = ''; - + foreach ($item as $inner_item) { //getting policy premium data $client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first(); - if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){ + if ($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7) { $policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first(); - }else{ + } else { $policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first(); } //end of getting policy premium data - if($inner_item['payable_employee'] == 1 && $client_policy_data['policy_type_id'] == 2){ + if ($inner_item['payable_employee'] == 1 && $client_policy_data['policy_type_id'] == 2) { $payable_employee_array[] = $inner_item; } $policy_name = $inner_item['policy_name']; - + if ($inner_item['relationship'] == 'Self') { $emp_code = ' (' . $inner_item['emp_code'] . ')'; } else { @@ -705,27 +656,27 @@ class sendMailNotification $premium = ''; $gst_forself = ''; // if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){ - $si = '₹ ' .format_indian_number($inner_item['basic_cover_si']); - $premium = '₹ ' .format_indian_number(round($inner_item['premium'])); - $gst_forself = '₹ ' .format_indian_number(round($inner_item['gst'])); + $si = '₹ ' . format_indian_number($inner_item['basic_cover_si']); + $premium = '₹ ' . format_indian_number(round($inner_item['premium'])); + $gst_forself = '₹ ' . format_indian_number(round($inner_item['gst'])); // } - + $temp_data .= '
' . $inner_item['name'] . $emp_code . '' . $inner_item['relationship'] . '' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '' . $si . '' . $premium . '' . $gst_forself . '
'; - + // Add text-align: center to the table head $table_content .= ''; $table_content .= ''; @@ -747,20 +698,20 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + // Only Display SI Topup and Dependent Addon if ($is_addon == 2 || $is_addon == 3) { $table_content .= ''; $table_content .= ''; } - + $table_content .= ''; $table_content .= ''; - + // Add text-align: center to the table body $table_content .= '' . $temp_data . ''; $table_content .= '
RelationDate Of BirthSum InsuredPremiumGST
'; - + if ($is_addon == 2 || $is_addon == 3) { $addon_list_array = [ 'policy_name' => $policy_name_for_policy_type, @@ -769,26 +720,26 @@ class sendMailNotification ]; $Addon_list[] = $addon_list_array; } - + $temp_data = ''; $addtional_premium = 0; $gst = 0; } - if(count($payable_employee_array) > 0){ + if (count($payable_employee_array) > 0) { $table_content .= '

Policy Type :'; $temp_data = ''; $is_addon = ''; - + foreach ($payable_employee_array as $inner_item) { //getting policy premium data $client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first(); - if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){ + if ($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7) { $policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first(); - }else{ + } else { $policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first(); } //end of getting policy premium data @@ -797,11 +748,11 @@ class sendMailNotification $si = ''; $premium = ''; $gst_forself = ''; - - $si = '₹ ' .format_indian_number($inner_item['basic_cover_si']); - $premium = '₹ ' .format_indian_number(round($inner_item['rata_premimum'])); - $gst_forself = '₹ ' .format_indian_number(round($inner_item['gst'])); - + + $si = '₹ ' . format_indian_number($inner_item['basic_cover_si']); + $premium = '₹ ' . format_indian_number(round($inner_item['rata_premimum'])); + $gst_forself = '₹ ' . format_indian_number(round($inner_item['gst'])); + $temp_data .= '

' . $inner_item['name'] . ($inner_item['relationship'] == 'Self' ? ' (' . $inner_item['emp_code'] . ')' : '') . '' . $inner_item['relationship'] . '' . $si . '' . $premium . '' . $gst_forself . '
'; - + // Add text-align: center to the table head $table_content .= ''; $table_content .= ''; @@ -835,15 +786,15 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + $table_content .= ''; $table_content .= ''; - + // Add text-align: center to the table body $table_content .= '' . $temp_data . ''; $table_content .= '
Sum InsuredPremiumGST
'; - - + + $addon_list_array = [ 'policy_name' => $policy_name_for_policy_type . '( Payable By Employee )', 'addtional_premium' => round($addtional_premium), @@ -851,19 +802,17 @@ class sendMailNotification ]; $Addon_list[] = $addon_list_array; - + $temp_data = ''; $addtional_premium = 0; $gst = 0; - } - } - + if (count($Addon_list) > 0) { $table_content .= '
'; $table_content .= ''; - + // Center align for table header and body $table_content .= ''; $table_content .= ''; @@ -873,14 +822,14 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + $table_content .= ''; - + $sum_total = 0; foreach ($Addon_list as $key => $value) { $total_addon = $value['gst'] + $value['addtional_premium']; $sum_total += $total_addon; - + $table_content .= ''; $table_content .= ''; $table_content .= ''; @@ -888,7 +837,7 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; } - + $sum_total_words = numberToWords($sum_total); $table_content .= ''; $table_content .= ''; @@ -898,45 +847,35 @@ class sendMailNotification $table_content .= '
Total
' . $value['policy_name'] . '₹' . format_indian_number($value['addtional_premium']) . '₹' . format_indian_number($total_addon) . '
Total
'; // $table_content .= '
' . $sum_total_words . '
'; } - - - $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); + + + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content, $mail_content); $account_manager_mail_list = []; - if(isset($user_list)){ + if (isset($user_list)) { foreach ($user_list as $key => $value) { - $full_name = $value['first_name'] .' ' .$value['last_name']; - $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $full_name , $mail_content); + $full_name = $value['first_name'] . ' ' . $value['last_name']; + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $full_name, $mail_content); - $header_of_mail = view('notification_mail_header', $params); - $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - $mail_content = $header_of_mail . - '
- + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - - - -
- ' . $mail_content . ' -
-
' . $footer_of_mail; + $data['params'] = $params; + $data['mail_content'] = $mail_content; + $mail_content = view('mail_template', $data); - - $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to'], 'common' => $common]; + + $wholeData[] = ['mail' => $value['email'], 'subject' => $subject, 'message' => $mail_content, 'reply_to' => $client_data['reply_to'], 'common' => $common]; // $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'}}; } return $wholeData; } - } + } } //else if($action == 'client_hr_summary_mail'){ // $client_id = $params['client_id']; // $client_policy_id = $params['client_policy_id']; // $common = $params['common']; - +data: name: name: // $clientModel = new ClientModel(); // $clientPolicyModel = new ClientPolicyModel(); // $PolicyPremium1Model = new PolicyPremium1Model(); @@ -958,17 +897,17 @@ class sendMailNotification // $user_list[]=$user_data; // } // } - - + + // $mail_content = $notification_data['mail_content']; // $subject = $notification_data['subject']; // $app_link = $_ENV['App_Url']; // $nhance_logo = $_ENV['NHANCE_LOGO']; - + // $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; // // $client_logo = $nhance_logo; - + // $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); // $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); // $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); @@ -982,7 +921,7 @@ class sendMailNotification // $gst = 0; // $array_list = $params['array_list']; // $Addon_list = []; - + // foreach ($array_list as $item) { // $payable_employee_array = []; @@ -992,7 +931,7 @@ class sendMailNotification // $temp_data = ''; // $policy_name = ''; // $is_addon = ''; - + // foreach ($item as $inner_item) { // //getting policy premium data @@ -1009,7 +948,7 @@ class sendMailNotification // } // $policy_name = $inner_item['policy_name']; - + // if ($inner_item['relationship'] == 'Self') { // $emp_code = ' (' . $inner_item['emp_code'] . ')'; // } else { @@ -1027,29 +966,29 @@ class sendMailNotification // $premium = '₹ ' .format_indian_number(round($inner_item['premium'])); // $gst_forself = '₹ ' .format_indian_number(round($inner_item['gst'])); // // } - + // $temp_data .= '
' . $inner_item['name'] . $emp_code . '' . $inner_item['relationship'] . '' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '' . $si . '' . $premium . '' . $gst_forself . '
'; - + // // Add text-align: center to the table head // $table_content .= ''; // $table_content .= ''; @@ -1065,20 +1004,20 @@ class sendMailNotification // $table_content .= ''; // $table_content .= ''; // $table_content .= ''; - + // // Only Display SI Topup and Dependent Addon // if ($is_addon == 2 || $is_addon == 3) { // $table_content .= ''; // $table_content .= ''; // } - + // $table_content .= ''; // $table_content .= ''; - + // // Add text-align: center to the table body // $table_content .= '' . $temp_data . ''; // $table_content .= '
RelationDate Of BirthSum InsuredPremiumGST
'; - + // if ($is_addon == 2 || $is_addon == 3) { // $addon_list_array = [ // 'policy_name' => $policy_name_for_policy_type, @@ -1087,7 +1026,7 @@ class sendMailNotification // ]; // $Addon_list[] = $addon_list_array; // } - + // $temp_data = ''; // $addtional_premium = 0; // $gst = 0; @@ -1098,7 +1037,7 @@ class sendMailNotification // $table_content .= '

Policy Type :'; // $temp_data = ''; // $is_addon = ''; - + // foreach ($payable_employee_array as $inner_item) { @@ -1115,11 +1054,11 @@ class sendMailNotification // $si = ''; // $premium = ''; // $gst_forself = ''; - + // $si = '₹ ' .format_indian_number($inner_item['basic_cover_si']); // $premium = '₹ ' .format_indian_number(round($inner_item['rata_premimum'])); // $gst_forself = '₹ ' .format_indian_number(round($inner_item['gst'])); - + // $temp_data .= '

' . $inner_item['name'] . ($inner_item['relationship'] == 'Self' ? ' (' . $inner_item['emp_code'] . ')' : '') . '' . $inner_item['relationship'] . '' . $si . '' . $premium . '' . $gst_forself . '
'; - + // // Add text-align: center to the table head // $table_content .= ''; // $table_content .= ''; @@ -1153,15 +1092,15 @@ class sendMailNotification // $table_content .= ''; // $table_content .= ''; // $table_content .= ''; - + // $table_content .= ''; // $table_content .= ''; - + // // Add text-align: center to the table body // $table_content .= '' . $temp_data . ''; // $table_content .= '
Sum InsuredPremiumGST
'; - - + + // $addon_list_array = [ // 'policy_name' => $policy_name_for_policy_type . '( Payable By Employee )', // 'addtional_premium' => round($addtional_premium), @@ -1169,18 +1108,18 @@ class sendMailNotification // ]; // $Addon_list[] = $addon_list_array; - + // $temp_data = ''; // $addtional_premium = 0; // $gst = 0; // } // } - + // if (count($Addon_list) > 0) { // $table_content .= '
'; // $table_content .= ''; - + // // Center align for table header and body // $table_content .= ''; // $table_content .= ''; @@ -1190,14 +1129,14 @@ class sendMailNotification // $table_content .= ''; // $table_content .= ''; // $table_content .= ''; - + // $table_content .= ''; - + // $sum_total = 0; // foreach ($Addon_list as $key => $value) { // $total_addon = $value['gst'] + $value['addtional_premium']; // $sum_total += $total_addon; - + // $table_content .= ''; // $table_content .= ''; // $table_content .= ''; @@ -1205,7 +1144,7 @@ class sendMailNotification // $table_content .= ''; // $table_content .= ''; // } - + // $sum_total_words = numberToWords($sum_total); // $table_content .= ''; // $table_content .= ''; @@ -1215,7 +1154,7 @@ class sendMailNotification // $table_content .= '
Total
' . $value['policy_name'] . '₹' . format_indian_number($value['addtional_premium']) . '₹' . format_indian_number($total_addon) . '
Total
'; // // $table_content .= '
' . $sum_total_words . '
'; // } - + // $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); @@ -1224,9 +1163,13 @@ class sendMailNotification // $mail_array = array_map('trim', $mail_array); // $wholeData = []; // foreach ($mail_array as $key => $value) { - // $header_of_mail = view('notification_mail_header', $params); - // $footer_of_mail = view('notification_mail_footer', $params); - // $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + // + // + // $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + + // $data['params'] = $params; + // $data['mail_content'] = $mail_content; + // $mail_content = view('mail_template',$data); // $mail_content = $header_of_mail . // '
// select('file_path, file_name') - ->where('notification_id', $notification['id']) - ->where('is_active', 1) - ->findAll(); - + ->select('file_path, file_name') + ->where('notification_id', $notification['id']) + ->where('is_active', 1) + ->findAll(); + $attachments = []; foreach ($attachment_data as $data) { $attachments[] = [ @@ -1279,7 +1222,7 @@ class sendMailNotification "fileName" => $data['file_name'] ]; } - + // print_r($attachments); die; $employee_name = 'John Doe'; @@ -1297,38 +1240,30 @@ class sendMailNotification $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); - + if ($mail != null || $mail != '') { - $header_of_mail = view('notification_mail_header', $params); - $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - $mail_content = $header_of_mail . - '
-
- - - -
- ' . $mail_content . ' -
-
' . $footer_of_mail; - - - $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'attachments' => $attachments]; - } - - return $wholeData; + // + // - } else if($action == 'member_reminder_mail'){ + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + + $data['params'] = $params; + $data['mail_content'] = $mail_content; + $mail_content = view('mail_template', $data); + + $wholeData = ['mail' => $mail, 'subject' => $subject, 'message' => $mail_content, 'bcc' => $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'attachments' => $attachments]; + } + + return $wholeData; + } else if ($action == 'member_reminder_mail') { $notification_data = $params['notification_data']; $client_data = $params['client_data']; $mail = $params['test_mail']; $mail_content = $notification_data['mail_content']; - $subject = $notification_data['subject']; + $subject = $notification_data['subject']; $nhance_logo = $_ENV['NHANCE_LOGO']; $app_link = $_ENV['App_Url']; @@ -1348,42 +1283,31 @@ class sendMailNotification if ((isset($notification_data) && $notification_data['enabled'] == 1)) { if (isset($mail) && !empty($mail)) { - $header_of_mail = view('notification_mail_header', $params); - $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - $mail_content = $header_of_mail . - '
- + + + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - - - -
- ' . $mail_content . ' -
-
' . $footer_of_mail; + $data['params'] = $params; + $data['mail_content'] = $mail_content; + $mail_content = view('mail_template', $data); - $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; + $wholeData = ['mail' => $mail, 'subject' => $subject, 'message' => $mail_content, 'bcc' => $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; } - } return $wholeData; - - - } else if($action == 'member_ecard_mail'){ + } else if ($action == 'member_ecard_mail') { $notification = $params['notification_data']; $client_data = $params['client_data']; $mail = $params['test_mail']; $mailAttachmentModel = new MailAttachmentModel(); $attachment_data = $mailAttachmentModel - ->select('file_path, file_name') - ->where('notification_id', $notification['id']) - ->where('is_active', 1) - ->findAll(); - + ->select('file_path, file_name') + ->where('notification_id', $notification['id']) + ->where('is_active', 1) + ->findAll(); + $attachments = []; foreach ($attachment_data as $data) { $attachments[] = [ @@ -1394,7 +1318,7 @@ class sendMailNotification $mail_content = $notification['mail_content']; $subject = $notification['subject']; - + $rand_string = 'HX3kUh'; $link = generate_download_link($rand_string); @@ -1404,9 +1328,9 @@ class sendMailNotification $nhance_logo = $_ENV['NHANCE_LOGO']; $app_link = $_ENV['App_Url']; $post_enrollment_app_link = $_ENV['POST_ENROLLMENT_APP_LINK']; - + $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; - + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); @@ -1417,43 +1341,34 @@ class sendMailNotification $mail_content = str_replace(["[[ecard_download_link]]", "{{ecard_download_link}}"], "Download Insurance Card", $mail_content); $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); - $header_of_mail = view('notification_mail_header', $params); - $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - $mail_content = $header_of_mail . - '
- + + + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - - - -
- ' . $mail_content . ' -
-
' . $footer_of_mail; + $data['params'] = $params; + $data['mail_content'] = $mail_content; + $mail_content = view('mail_template', $data); - $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'],'attachments' => $attachments, 'reply_to' => $client_data['reply_to']]; + $wholeData = ['mail' => $mail, 'subject' => $subject, 'message' => $mail_content, 'bcc' => $client_data['common_mails'], 'attachments' => $attachments, 'reply_to' => $client_data['reply_to']]; return $wholeData; - - } else if($action == 'member_review_and_summary_mail'){ + } else if ($action == 'member_review_and_summary_mail') { $array_list = [ - 'policy_name' => 'Health Insurance Plan', - 'emp_code' => 'E12345', - 'name' => 'John Doe', - 'relationship' => 'Self', - 'dob' => '1985-05-15', - 'basic_cover_si' => 500000, - 'premium' => 12000, - 'gst' => 2160, - 'rata_premimum' => 12000, - 'is_addon' => 2, - 'mobile' => 9080706050 + 'policy_name' => 'Health Insurance Plan', + 'emp_code' => 'E12345', + 'name' => 'John Doe', + 'relationship' => 'Self', + 'dob' => '1985-05-15', + 'basic_cover_si' => 500000, + 'premium' => 12000, + 'gst' => 2160, + 'rata_premimum' => 12000, + 'is_addon' => 2, + 'mobile' => 9080706050 ]; - + $notification_data = $params['notification_data']; $client_data = $params['client_data']; @@ -1466,7 +1381,7 @@ class sendMailNotification $app_link = $_ENV['App_Url']; $nhance_logo = $_ENV['NHANCE_LOGO']; - + $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); @@ -1483,19 +1398,19 @@ class sendMailNotification $name = $array_list['name']; $mobile = $array_list['mobile']; $emp_code = ''; - + if (!empty($array_list)) { $table_content .= '

Policy Type :'; - + $policy_name = $array_list['policy_name']; - + if ($array_list['relationship'] == 'Self') { $emp_code = ' (' . $array_list['emp_code'] . ')'; } else { $emp_code = ''; } - + // Start table row $table_content .= $policy_name . '

'; $table_content .= ''; @@ -1505,16 +1420,16 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + // Only Display SI Topup and Dependent Addon if ($array_list['is_addon'] == 2 || $array_list['is_addon'] == 3) { $table_content .= ''; $table_content .= ''; } - + $table_content .= ''; $table_content .= ''; - + // Table body with details $table_content .= ''; $table_content .= ''; @@ -1522,21 +1437,21 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + if ($array_list['is_addon'] == 2 || $array_list['is_addon'] == 3) { $table_content .= ''; $table_content .= ''; } - + $table_content .= ''; $table_content .= ''; $table_content .= '
RelationDate Of BirthSum InsuredPremiumGST
' . $array_list['relationship'] . '' . \DateTime::createFromFormat('Y-m-d', $array_list['dob'])->format('d-m-Y') . '₹' . format_indian_number($array_list['basic_cover_si']) . '₹' . format_indian_number(round($array_list['premium'])) . '₹' . format_indian_number(round($array_list['gst'])) . '
'; - + // Calculate additional premium and GST if applicable if ($array_list['is_addon'] == 2 || $array_list['is_addon'] == 3) { $addtional_premium = $array_list['rata_premimum']; $gst = $array_list['gst']; - + // Prepare addon summary $addon_list_array = [ 'policy_name' => $policy_name, @@ -1546,12 +1461,12 @@ class sendMailNotification $Addon_list[] = $addon_list_array; } - + // Generate summary table for addon if applicable if (count($Addon_list) > 0) { $table_content .= '
'; $table_content .= ''; - + $table_content .= ''; $table_content .= ''; $table_content .= ''; @@ -1560,9 +1475,9 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + $table_content .= ''; - + $total_addon = $Addon_list[0]['gst'] + $Addon_list[0]['addtional_premium']; $table_content .= ''; $table_content .= ''; @@ -1570,7 +1485,7 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + $sum_total_words = numberToWords($total_addon); $table_content .= ''; $table_content .= ''; @@ -1579,36 +1494,26 @@ class sendMailNotification $table_content .= ''; $table_content .= '
Policy NameTotal
' . $Addon_list[0]['policy_name'] . '₹' . format_indian_number($Addon_list[0]['gst']) . '₹' . format_indian_number($total_addon) . '
Total
'; } - } - - $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')' , $mail_content); + } + + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')', $mail_content); $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $mobile, $mail_content); - $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content, $mail_content); - $header_of_mail = view('notification_mail_header', $params); - $footer_of_mail = view('notification_mail_footer', $params); + + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - $mail_content = $header_of_mail . - '
- - - - -
- ' . $mail_content . ' -
-
' . $footer_of_mail; + $data['params'] = $params; + $data['mail_content'] = $mail_content; + $mail_content = view('mail_template', $data); - $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; + $wholeData = ['mail' => $mail, 'subject' => $subject, 'message' => $mail_content, 'bcc' => $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; return $wholeData; - } - - } else if($action == 'account_maneger_summary_mail'){ + } else if ($action == 'account_maneger_summary_mail') { $array_list = [ 'policy_name' => 'Health Insurance Plan', @@ -1627,14 +1532,14 @@ class sendMailNotification $client_data = $params['client_data']; $mail = $params['test_mail']; - if (isset($notification_data) && $notification_data['enabled'] == 1) { - + if (isset($notification_data) && $notification_data['enabled'] == 1) { + $mail_content = $notification_data['mail_content']; $subject = $notification_data['subject']; $app_link = $_ENV['App_Url']; $nhance_logo = $_ENV['NHANCE_LOGO']; - + $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); @@ -1650,18 +1555,18 @@ class sendMailNotification $Addon_list = []; $name = $array_list['name']; $emp_code = ''; - + if (!empty($array_list)) { $table_content .= '

Policy Type :'; - + $policy_name = $array_list['policy_name']; - + if ($array_list['relationship'] == 'Self') { $emp_code = ' (' . $array_list['emp_code'] . ')'; } else { $emp_code = ''; } - + // Start table row $table_content .= $policy_name . '

'; $table_content .= ''; @@ -1671,16 +1576,16 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + // Only Display SI Topup and Dependent Addon if ($array_list['is_addon'] == 2 || $array_list['is_addon'] == 3) { $table_content .= ''; $table_content .= ''; } - + $table_content .= ''; $table_content .= ''; - + // Table body with details $table_content .= ''; $table_content .= ''; @@ -1688,21 +1593,21 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + if ($array_list['is_addon'] == 2 || $array_list['is_addon'] == 3) { $table_content .= ''; $table_content .= ''; } - + $table_content .= ''; $table_content .= ''; $table_content .= '
RelationDate Of BirthSum InsuredPremiumGST
' . $array_list['relationship'] . '' . \DateTime::createFromFormat('Y-m-d', $array_list['dob'])->format('d-m-Y') . '₹' . format_indian_number($array_list['basic_cover_si']) . '₹' . format_indian_number(round($array_list['premium'])) . '₹' . format_indian_number(round($array_list['gst'])) . '
'; - + // Calculate additional premium and GST if applicable if ($array_list['is_addon'] == 2 || $array_list['is_addon'] == 3) { $addtional_premium = $array_list['rata_premimum']; $gst = $array_list['gst']; - + // Prepare addon summary $addon_list_array = [ 'policy_name' => $policy_name, @@ -1712,12 +1617,12 @@ class sendMailNotification $Addon_list[] = $addon_list_array; } - + // Generate summary table for addon if applicable if (count($Addon_list) > 0) { $table_content .= '
'; $table_content .= ''; - + $table_content .= ''; $table_content .= ''; $table_content .= ''; @@ -1726,9 +1631,9 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + $table_content .= ''; - + $total_addon = $Addon_list[0]['gst'] + $Addon_list[0]['addtional_premium']; $table_content .= ''; $table_content .= ''; @@ -1736,7 +1641,7 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + $sum_total_words = numberToWords($total_addon); $table_content .= ''; $table_content .= ''; @@ -1745,34 +1650,25 @@ class sendMailNotification $table_content .= ''; $table_content .= '
Policy NameTotal
' . $Addon_list[0]['policy_name'] . '₹' . format_indian_number($Addon_list[0]['gst']) . '₹' . format_indian_number($total_addon) . '
Total
'; } - } + } - $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')' , $mail_content); - $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')', $mail_content); + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content, $mail_content); - $header_of_mail = view('notification_mail_header', $params); - $footer_of_mail = view('notification_mail_footer', $params); - $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - $mail_content = $header_of_mail . - '
- - - - - -
- ' . $mail_content . ' -
-
' . $footer_of_mail; - - - $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']]; + + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); + + $data['params'] = $params; + $data['mail_content'] = $mail_content; + $mail_content = view('mail_template', $data); + + + $wholeData = ['mail' => $mail, 'subject' => $subject, 'message' => $mail_content, 'reply_to' => $client_data['reply_to']]; + return $wholeData; } - - } else if($action == 'client_hr_summary_mail'){ + } else if ($action == 'client_hr_summary_mail') { $array_list = [ 'policy_name' => 'Health Insurance Plan', @@ -1791,16 +1687,16 @@ class sendMailNotification $client_data = $params['client_data']; $mail = $params['test_mail']; - if (isset($notification_data['enabled']) && $notification_data['enabled'] == 1) { - + if (isset($notification_data['enabled']) && $notification_data['enabled'] == 1) { + $mail_content = $notification_data['mail_content']; $subject = $notification_data['subject']; $app_link = $_ENV['App_Url']; $nhance_logo = $_ENV['NHANCE_LOGO']; - + $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; - + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); @@ -1814,19 +1710,19 @@ class sendMailNotification $Addon_list = []; $name = $array_list['name']; $emp_code = ''; - + if (!empty($array_list)) { - + $table_content .= '

Policy Type :'; - + $policy_name = $array_list['policy_name']; - + if ($array_list['relationship'] == 'Self') { $emp_code = ' (' . $array_list['emp_code'] . ')'; } else { $emp_code = ''; } - + // Start table row $table_content .= $policy_name . '

'; $table_content .= ''; @@ -1836,16 +1732,16 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + // Only Display SI Topup and Dependent Addon if ($array_list['is_addon'] == 2 || $array_list['is_addon'] == 3) { $table_content .= ''; $table_content .= ''; } - + $table_content .= ''; $table_content .= ''; - + // Table body with details $table_content .= ''; $table_content .= ''; @@ -1853,21 +1749,21 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + if ($array_list['is_addon'] == 2 || $array_list['is_addon'] == 3) { $table_content .= ''; $table_content .= ''; } - + $table_content .= ''; $table_content .= ''; $table_content .= '
RelationDate Of BirthSum InsuredPremiumGST
' . $array_list['relationship'] . '' . \DateTime::createFromFormat('Y-m-d', $array_list['dob'])->format('d-m-Y') . '₹' . format_indian_number($array_list['basic_cover_si']) . '₹' . format_indian_number(round($array_list['premium'])) . '₹' . format_indian_number(round($array_list['gst'])) . '
'; - + // Calculate additional premium and GST if applicable if ($array_list['is_addon'] == 2 || $array_list['is_addon'] == 3) { $addtional_premium = $array_list['rata_premimum']; $gst = $array_list['gst']; - + // Prepare addon summary $addon_list_array = [ 'policy_name' => $policy_name, @@ -1877,13 +1773,13 @@ class sendMailNotification $Addon_list[] = $addon_list_array; } - + // Generate summary table for addon if applicable if (count($Addon_list) > 0) { $table_content .= '
'; $table_content .= ''; - + $table_content .= ''; $table_content .= ''; $table_content .= ''; @@ -1892,9 +1788,9 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + $table_content .= ''; - + $total_addon = $Addon_list[0]['gst'] + $Addon_list[0]['addtional_premium']; $table_content .= ''; $table_content .= ''; @@ -1902,7 +1798,7 @@ class sendMailNotification $table_content .= ''; $table_content .= ''; $table_content .= ''; - + $sum_total_words = numberToWords($total_addon); $table_content .= ''; $table_content .= ''; @@ -1911,33 +1807,23 @@ class sendMailNotification $table_content .= ''; $table_content .= '
Policy NameTotal
' . $Addon_list[0]['policy_name'] . '₹' . format_indian_number($Addon_list[0]['gst']) . '₹' . format_indian_number($total_addon) . '
Total
'; } - } - - $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')' , $mail_content); - $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); + } - $header_of_mail = view('notification_mail_header', $params); - $footer_of_mail = view('notification_mail_footer', $params); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')', $mail_content); + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content, $mail_content); + + + $mail_content = preg_replace('/]*>( |\s)*<\/p>/i', '', $mail_content); - $mail_content = $header_of_mail . - '
- - - - -
- ' . $mail_content . ' -
-
' . $footer_of_mail; + $data['params'] = $params; + $data['mail_content'] = $mail_content; + $mail_content = view('mail_template', $data); - - $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']]; + $wholeData = ['mail' => $mail, 'subject' => $subject, 'message' => $mail_content, 'reply_to' => $client_data['reply_to']]; return $wholeData; } - - } - } -} \ No newline at end of file + } + } +} diff --git a/app/Views/DashBoard.php b/app/Views/DashBoard.php index 2272c30..2fcf0ce 100755 --- a/app/Views/DashBoard.php +++ b/app/Views/DashBoard.php @@ -184,8 +184,6 @@ body {
- -