This commit is contained in:
baodev0
2026-10-05 09:30:24 +07:00
parent a1aeb88061
commit 1544629a1f
53 changed files with 1292 additions and 963 deletions
+8 -21
View File
@@ -2,18 +2,14 @@
namespace App\Mail;
use App\Mail\Concerns\RequiresDbTemplate;
use App\Models\Customer;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class VmSuspendedMail extends Mailable implements ShouldQueue
class VmSuspendedMail extends TemplateMailable implements ShouldQueue
{
use Queueable, SerializesModels, RequiresDbTemplate;
use Queueable, SerializesModels;
public function __construct(
public readonly Customer $customer,
@@ -21,26 +17,17 @@ class VmSuspendedMail extends Mailable implements ShouldQueue
public readonly string $vmwareId,
) {}
public function envelope(): Envelope
{
return new Envelope(
subject: $this->renderFromTemplate('vm_suspended', $this->vars())['subject'],
);
}
public function content(): Content
{
return new Content(
htmlString: $this->renderFromTemplate('vm_suspended', $this->vars())['html'],
);
}
public function attachments(): array
{
return [];
}
private function vars(): array
protected function scenario(): string
{
return 'vm_suspended';
}
protected function variables(): array
{
return [
'customer_name' => $this->customer->fullname,