diff --git a/app/Controllers/NotificationController.php b/app/Controllers/NotificationController.php index 64988466..6efe58e3 100755 --- a/app/Controllers/NotificationController.php +++ b/app/Controllers/NotificationController.php @@ -57,7 +57,7 @@ class NotificationController extends AdminController $form_data['mail_content'] = $this->request->getPost('mailContent'); $form_data['client_id'] = $this->request->getPost('client_id'); $form_data['mail_content_json'] = $this->request->getPost('mailJson'); - $form_data['email_list'] = $this->request->getPost('email_list'); + $form_data['email_list'] = $this->request->getPost('email_list')??''; $notificationModel = new NotificationModel(); $find_notification = $notificationModel->where('client_id',$form_data['client_id'])->where('template_name',$form_data['template_name'])->first(); @@ -195,11 +195,17 @@ class NotificationController extends AdminController public function getMailTemplateData($template_name,$client_id) { $notificationModel = new NotificationModel(); - $value = $notificationModel->where('client_id',$client_id)->where('template_name',$template_name)->first(); - if($value){ - $value['data'] = $this->MailAttachmentModel->where('notification_id', $value['id'])->where('is_active', 1)->findAll(); + $value = $notificationModel->where('client_id',$client_id)->where('template_name',$template_name)->first()??[]; + if(!empty($value)){ + $value['data'] = $this->MailAttachmentModel->where('notification_id', $value['id'])->where('is_active', 1)->findAll()??[]; } - // return $this->respond(['status' => true, 'code' => 200, '' => 'Attachment deleted successfully'], 200); + + if( isset($value['template_name']) && !empty($value['template_name']) && $value['template_name'] == "member_common_mail"){ + $value['common_mails'] = $this->CommonEMailModel->where('notification_id',$value['id'])->findAll()??[]; + } + + + return json_encode($value); } diff --git a/app/Views/mail_template.php b/app/Views/mail_template.php index b0360cd3..29e8569c 100644 --- a/app/Views/mail_template.php +++ b/app/Views/mail_template.php @@ -1,3 +1,8 @@ + + @@ -10,7 +15,7 @@