CHANGE_email notification to acc manger while inception - VADIVEL J 2025-10-25

This commit is contained in:
vadivelJ96 2025-10-25 18:29:08 +05:30
parent 5585d3668d
commit 5af308f596

View File

@ -4174,7 +4174,11 @@ class EmployeeRestController extends AdminController
];
// Save into DB
$this->hrFileUploadModel->insert($data);
$result = $this->hrFileUploadModel->insert($data);
if($result && $data['file_action'] == "addition"){
$this->giveNotificationToClientsAccountManager($data);
}
return $this->respondCreated([
'status' => true,
@ -4188,6 +4192,39 @@ class EmployeeRestController extends AdminController
}
private function giveNotificationToClientsAccountManager($data){
// $data = [
// 'client_id' => $this->request->getPost('client_id'),
// 'client_branch_id' => $this->request->getPost('client_branch_id'),
// 'policy_id' => $this->request->getPost('policy_id'),
// 'policy_no' => $this->request->getPost('policy_no'),
// 'file_name' => $newFileName,
// 'file_action' => $this->request->getPost('file_action'),
// 'status' => 'Yet to start',
// 'created_by' => $this->request->getPost('created_by'),
// 'updated_by' => $this->request->getPost('created_by'),
// ];
$account_manager_email = $this->clientRMModel->findAccountManagerEmail($data['client_id']);
$from_mail = "";
$to_mail = $account_manager_email;
$subject = "Inception Notification";
$message = "Inception for Policy_No -" . $data['policy_no'] . " is uploaded . Awaiting Action..!!";
$cc_string = "";
$attachments = "";
$reply_to = "";
$bcc_string = "";
MailHelper::send_email(['from_mail' => $from_mail, 'mail' => $to_mail, 'cc' => $cc_string, 'subject' => $subject, 'message' => $message, 'attachments' => $attachments, 'reply_to' => $reply_to, 'bcc' => $bcc_string]);
}
public function updateHrFileUploadData()
{
try {