47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
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 CustomerRegister extends Mailable
|
|
{
|
|
use Queueable, SerializesModels, RequiresDbTemplate;
|
|
|
|
/** @param int $template Không còn dùng — scenario cố định 'customer_signup_verify'. Giữ tham số để không phá vỡ caller hiện tại. */
|
|
public function __construct($template = 0, public $data = []) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: $this->renderFromTemplate('customer_signup_verify', $this->vars())['subject'],
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
htmlString: $this->renderFromTemplate('customer_signup_verify', $this->vars())['html'],
|
|
);
|
|
}
|
|
|
|
public function attachments(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
private function vars(): array
|
|
{
|
|
return [
|
|
'company_name' => $this->data['company_name'] ?? '',
|
|
'company_logo' => $this->data['company_logo'] ?? '',
|
|
'link_verify' => $this->data['link_verify'] ?? '',
|
|
];
|
|
}
|
|
}
|