diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index 9136801e..a5af0834 100755 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -1226,6 +1226,20 @@ class sendMailNotification $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(); + + $attachments = []; + foreach ($attachment_data as $data) { + $attachments[] = [ + "filePath" => WRITEPATH . $data['file_path'], + "fileName" => $data['file_name'] + ]; + } $mail_content = $notification['mail_content']; $subject = $notification['subject']; @@ -1252,7 +1266,7 @@ class sendMailNotification $mail_content = str_replace("[[ecard_download_link]]", "Download Insurance Card", $mail_content); $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); - $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'],'attachments' => $attachments, 'reply_to' => $client_data['reply_to']]; return $wholeData; diff --git a/app/Views/notification.php b/app/Views/notification.php index 87671314..cb738661 100755 --- a/app/Views/notification.php +++ b/app/Views/notification.php @@ -175,7 +175,7 @@ - Edit + Edit
| Attachments | +Action | +
|---|