Files
portal-api/app/Mail/Customer/ManualCustomerEmail.php
T
baodev0andClaude Opus 5.5 30898ea46f feat: email gửi tay/nhắc gia hạn, gói hosting, sửa dữ liệu sản phẩm
- Gửi email theo template cho 1 khách, tab lịch sử email, nhắc gia hạn dịch vụ hàng loạt
- Mail lưu from/bcc/sent_by; mẫu MARKETING và mẫu cũ trong TemplateSeeder
- Gói hosting: giới hạn, trạng thái, lấy plan Plesk qua CLI gateway
- Backfill payment_method và ngày đơn hàng còn thiếu
- Bổ sung field CPU/RAM/Disk/Băng thông cho loại sản phẩm vps và cloud

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:32:05 +07:00

43 lines
1.1 KiB
PHP

<?php
namespace App\Mail\Customer;
use App\Models\Template;
use App\Support\EmailTemplateShell;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class ManualCustomerEmail extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
public function __construct(
private readonly string $emailSubject,
private readonly string $htmlContent,
private readonly bool $wrapLayout = true,
) {}
public function envelope(): Envelope
{
return new Envelope(subject: $this->emailSubject);
}
public function content(): Content
{
return new Content(
htmlString: $this->wrapLayout
? Template::renderWithLayout($this->emailSubject, $this->htmlContent)
: EmailTemplateShell::document($this->emailSubject, $this->htmlContent),
);
}
public function attachments(): array
{
return [];
}
}