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
+18 -8
View File
@@ -2,6 +2,7 @@
namespace App\Mail\Admin;
use App\Mail\Concerns\RequiresDbTemplate;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
@@ -11,7 +12,7 @@ use Illuminate\Queue\SerializesModels;
class DomainOrderNewNotification extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
use Queueable, SerializesModels, RequiresDbTemplate;
public function __construct(
protected array $data,
@@ -20,19 +21,28 @@ class DomainOrderNewNotification extends Mailable implements ShouldQueue
public function envelope(): Envelope
{
return new Envelope(
subject: "[ADMIN] Đơn đăng ký tên miền mới - {$this->data['domain_name']}",
subject: $this->renderFromTemplate('admin_domain_order_new', $this->vars())['subject'],
);
}
public function content(): Content
{
return new Content(
view: 'emails.layouts.notification',
with: [
'companyName' => $this->data['company_name'] ?? config('app.name'),
'title' => 'Thông báo đơn đăng ký tên miền mới',
'body' => view('emails.admin.domain-order-new', $this->data)->render(),
],
htmlString: $this->renderFromTemplate('admin_domain_order_new', $this->vars())['html'],
);
}
private function vars(): array
{
return [
'company_name' => $this->data['company_name'] ?? config('app.name'),
'domain_name' => $this->data['domain_name'] ?? '',
'order_num' => $this->data['order_num'] ?? '',
'order_total' => $this->data['order_total'] ?? '',
'customer_name' => $this->data['customer_name'] ?? '',
'customer_email' => $this->data['customer_email'] ?? '',
'created_at' => $this->data['created_at'] ?? now()->format('d/m/Y H:i:s'),
'admin_url' => $this->data['admin_url'] ?? '',
];
}
}