Menambahkan fitur kirim email tender part 1

This commit is contained in:
2024-11-20 08:24:59 +07:00
parent 7db25c2226
commit 17ca3b2e50
18 changed files with 1554 additions and 25 deletions

View File

@@ -0,0 +1,67 @@
<?php
namespace Modules\Lpj\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Facades\Mail;
use Modules\Lpj\Emails\SendPenawaranKJPPEmail;
class SendPenawaranKJPPTenderJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $kjpps;
protected $dp1; // Tidak perlu array [0] lagi
protected $penawaran;
protected $permohonan;
protected $villages;
protected $districts;
protected $cities;
protected $provinces;
/**
* Create a new job instance.
*/
public function __construct($kjpps, $dp1, $penawaran, $permohonan, $villages, $districts, $cities, $provinces)
{
$this->kjpps = $kjpps;
$this->dp1 = $dp1; // Simpan keseluruhan array dp1, bukan dp1[0]
$this->penawaran = $penawaran;
$this->permohonan = $permohonan;
$this->villages = $villages;
$this->districts = $districts;
$this->cities = $cities;
$this->provinces = $provinces;
}
/**
* Execute the job.
*/
public function handle(): void
{
$email = new SendPenawaranKJPPEmail(
$this->dp1,
$this->penawaran,
$this->permohonan,
$this->villages,
$this->districts,
$this->cities,
$this->provinces
);
$email->with([
'dp1' => $this->dp1, // Kirim seluruh array dp1 ke email
'penawaran' => $this->penawaran,
'permohonan' => $this->permohonan,
'villages' => $this->villages,
'districts' => $this->districts,
'cities' => $this->cities,
'provinces' => $this->provinces,
]);
Mail::to($this->kjpps)->send($email);
}
}

View File

@@ -0,0 +1,56 @@
<?php
namespace Modules\Lpj\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Facades\Mail;
use Modules\Lpj\Emails\SendPenawaranTenderEmail;
class SendPenawaranTenderJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $kjpps;
protected $penawaran;
protected $permohonan;
protected $villages;
protected $districts;
protected $cities;
protected $provinces;
/**
* Create a new job instance.
*/
public function __construct($kjpps, $penawaran, $permohonan, $villages, $districts, $cities, $provinces)
{
$this->kjpps = $kjpps;
$this->penawaran = $penawaran;
$this->permohonan = $permohonan;
$this->villages = $villages;
$this->districts = $districts;
$this->cities = $cities;
$this->provinces = $provinces;
}
/**
* Execute the job.
*/
public function handle(): void
{
$email = new SendPenawaranTenderEmail();
$email->with([
'penawaran' => $this->penawaran,
'permohonan' => $this->permohonan,
'villages' => $this->villages,
'districts' => $this->districts,
'cities' => $this->cities,
'provinces' => $this->provinces,
]);
Mail::to($this->kjpps)->send($email);
}
}