Update notifikasi send email
This commit is contained in:
@@ -22,6 +22,7 @@ use Modules\Internal\Transformers\ClaimHistoryCareResource;
|
||||
use Box\Spout\Reader\Common\Creator\ReaderEntityFactory;
|
||||
use Box\Spout\Writer\Common\Creator\WriterEntityFactory;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
use PDF;
|
||||
|
||||
@@ -928,16 +929,19 @@ class ClaimController extends Controller
|
||||
$note = $request->input('note');
|
||||
|
||||
$dataToInsert = [];
|
||||
$description = "";
|
||||
if ($condition) {
|
||||
$dataToInsert[] = [
|
||||
'claim_request_id' => $claim_id,
|
||||
'date' => date('Y-m-d H:i:s'),
|
||||
'type' => 'claim-kondisi',
|
||||
'description' => $note,
|
||||
'created_by' =>auth()->user()->id,
|
||||
'created_by' => auth()->user()->id,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
$description = "Condition";
|
||||
$this->sendNotif($description);
|
||||
}
|
||||
if ($diagnosis) {
|
||||
$dataToInsert[] = [
|
||||
@@ -949,6 +953,8 @@ class ClaimController extends Controller
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
$description = "Diagnosis";
|
||||
$this->sendNotif($description);
|
||||
}
|
||||
if ($result) {
|
||||
$dataToInsert[] = [
|
||||
@@ -960,12 +966,42 @@ class ClaimController extends Controller
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
$description = "Result";
|
||||
$this->sendNotif($description);
|
||||
}
|
||||
DB::table('claim_request_files')->insert($dataToInsert);
|
||||
|
||||
return Helper::responseJson([]);
|
||||
}
|
||||
|
||||
public function sendNotif($description)
|
||||
{
|
||||
// Insert data notifications
|
||||
$dataNotif = [
|
||||
'hospital_id' => 1,
|
||||
'title' => 'Request Document',
|
||||
'description' => 'Please enter the document '.$description,
|
||||
'type' => 1,
|
||||
'isUnRead' => true,
|
||||
'created_by' => auth()->user()->id,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
$sendNotif = Helper::insertNotification($dataNotif);
|
||||
// Send Email after insert notifications
|
||||
if($sendNotif)
|
||||
{
|
||||
//Beluma ada Data Users
|
||||
$dataEmail = [
|
||||
'email' => 'akun.kerja.ivan@gmail.com',
|
||||
'name' => 'Ivan Julian',
|
||||
'subject' => 'Enter Document '.$description,
|
||||
'body' => View::make('email/notif_email', ['name' => 'Ivan Julian', 'link' => 'https://linkmedis.com/chat'])->render(),
|
||||
];
|
||||
Helper::sendEmail($dataEmail);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////// History Care Hospital ///////////////////////////
|
||||
|
||||
public function storeHistoryCare(Request $request, $id){
|
||||
|
||||
Reference in New Issue
Block a user