update email template
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Mail\Concerns\RequiresDbTemplate;
|
||||
use App\Models\Customer;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
@@ -12,7 +13,7 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class VmSuspendedMail extends Mailable implements ShouldQueue
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
use Queueable, SerializesModels, RequiresDbTemplate;
|
||||
|
||||
public function __construct(
|
||||
public readonly Customer $customer,
|
||||
@@ -23,19 +24,14 @@ class VmSuspendedMail extends Mailable implements ShouldQueue
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: '[Thế Giới Số] Dịch vụ Cloud VPS của bạn đã bị tạm ngưng',
|
||||
subject: $this->renderFromTemplate('vm_suspended', $this->vars())['subject'],
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'emails.customer.vm-suspended',
|
||||
with: [
|
||||
'customerName' => $this->customer->fullname,
|
||||
'vmName' => $this->vmName,
|
||||
'vmwareId' => $this->vmwareId,
|
||||
],
|
||||
htmlString: $this->renderFromTemplate('vm_suspended', $this->vars())['html'],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -43,4 +39,17 @@ class VmSuspendedMail extends Mailable implements ShouldQueue
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function vars(): array
|
||||
{
|
||||
return [
|
||||
'customer_name' => $this->customer->fullname,
|
||||
'vm_name' => $this->vmName,
|
||||
'vmware_id' => $this->vmwareId,
|
||||
'suspended_at' => now()->setTimezone('Asia/Ho_Chi_Minh')->format('d/m/Y H:i'),
|
||||
'login_url' => rtrim(config('app.frontend_url', ''), '/') . '/dang-nhap',
|
||||
'support_email' => 'support@tgs.com.vn',
|
||||
'support_phone' => '(028) 7309. 7379',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user