Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
VENKATESHWARAN 2025-11-05 17:19:23 +05:30
commit 642cce286f
2 changed files with 18 additions and 7 deletions

View File

@ -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);
}

View File

@ -1,3 +1,8 @@
<?php
$value = json_decode($params['notification_data']['mail_content_json']??[],true);
$contentWidth = (int)$value['body']['values']['contentWidth']??500;
?>
<!DOCTYPE html>
<html lang="en">
@ -10,7 +15,7 @@
<style>
.mail-template-header {
max-width: 500px;
max-width: <?=$contentWidth?>px;
background-color: #ffffff !important;
border-bottom: 1px solid #00999E;
width: 100%; /* default: allow full width */
@ -26,7 +31,7 @@
}
.mail-template-footer {
max-width: 500px;
max-width: <?=$contentWidth?>px;
background-color: #ffffff !important;
border-top: 1px solid #00999E;
width: 100%; /* default: allow full width */