update
This commit is contained in:
@@ -2,16 +2,14 @@
|
||||
|
||||
namespace App\Mail\Customer;
|
||||
|
||||
use App\Mail\Concerns\RequiresDbTemplate;
|
||||
use App\Mail\TemplateMailable;
|
||||
use App\Support\MailGlobals;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class VmRebuildFailed extends Mailable
|
||||
class VmRebuildFailed extends TemplateMailable
|
||||
{
|
||||
use Queueable, SerializesModels, RequiresDbTemplate;
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public array $data;
|
||||
|
||||
@@ -20,33 +18,24 @@ class VmRebuildFailed extends Mailable
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: $this->renderFromTemplate('vm_rebuild_failed', $this->vars())['subject'],
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
htmlString: $this->renderFromTemplate('vm_rebuild_failed', $this->vars())['html'],
|
||||
);
|
||||
}
|
||||
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function vars(): array
|
||||
protected function scenario(): string
|
||||
{
|
||||
return 'vm_rebuild_failed';
|
||||
}
|
||||
|
||||
protected function variables(): array
|
||||
{
|
||||
return [
|
||||
'app_name' => config('app.name', 'Thế Giới Số'),
|
||||
'full_name' => $this->data['customer_name'] ?? 'Khách hàng',
|
||||
'vm_name' => $this->data['vm_name'] ?? 'N/A',
|
||||
'ip' => $this->data['ip'] ?? 'N/A',
|
||||
'service_url' => rtrim((string) env('FRONTEND_URL', config('app.url')), '/') . '/dich-vu',
|
||||
'service_url' => MailGlobals::frontendUrl() . '/dich-vu',
|
||||
'support_email' => config('mail.support_email', 'support@example.com'),
|
||||
'support_phone' => config('mail.support_phone', '1900-xxxx'),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user