Files
portal-api/app/Mail/ChangePortRemote.php
T
2026-09-09 16:56:22 +07:00

43 lines
983 B
PHP

<?php
namespace App\Mail;
use App\Mail\Concerns\RequiresDbTemplate;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class ChangePortRemote extends Mailable
{
use Queueable, SerializesModels, RequiresDbTemplate;
public function __construct(
public string $vmName,
public string $newPort
) {}
public function envelope(): Envelope
{
return new Envelope(
subject: $this->renderFromTemplate('vm_port_change', $this->vars())['subject'],
);
}
public function content(): Content
{
return new Content(
htmlString: $this->renderFromTemplate('vm_port_change', $this->vars())['html'],
);
}
private function vars(): array
{
return [
'vm_name' => $this->vmName,
'new_port' => $this->newPort,
];
}
}