update email template

This commit is contained in:
baodev0
2026-09-09 16:56:22 +07:00
parent d3d9f76ba0
commit 2365ef72e9
210 changed files with 6335 additions and 4688 deletions
+21 -5
View File
@@ -2,8 +2,8 @@
namespace App\Mail;
use App\Mail\Concerns\RequiresDbTemplate;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
@@ -11,16 +11,32 @@ use Illuminate\Queue\SerializesModels;
class ChangePortRemote extends Mailable
{
use Queueable, SerializesModels;
use Queueable, SerializesModels, RequiresDbTemplate;
public function __construct(
public string $vmName,
public string $newPort
) {}
public function build(): ChangePortRemote
public function envelope(): Envelope
{
return $this->subject('Port VPS của bạn đã được thay đổi')
->view('emails.vm_port_change');
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,
];
}
}