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>
This commit is contained in:
baodev0
2026-10-09 11:32:05 +07:00
co-authored by Claude Opus 5.5
parent 8651dde6b1
commit 30898ea46f
59 changed files with 1771 additions and 108 deletions
@@ -34,6 +34,26 @@ trait ManagesCustomerAccount
return response()->json(['error' => false, 'message' => 'Đã gửi mật khẩu mới cho khách hàng.']);
}
public function emailPreview(Request $request, string $uuid): JsonResponse
{
$data = $request->validate(['template_id' => 'required|integer']);
return response()->json([
'error' => false,
'data' => $this->mailService->previewTemplateEmail($uuid, (int) $data['template_id']),
]);
}
public function emailLayout(Request $request, string $uuid): JsonResponse
{
$data = $request->validate(['message' => 'nullable|string']);
return response()->json([
'error' => false,
'data' => ['html' => $this->mailService->wrapWithLayout($uuid, (string) ($data['message'] ?? ''))],
]);
}
public function sendEmail(Request $request, string $uuid): JsonResponse
{
$data = $request->validate([
@@ -43,6 +63,7 @@ trait ManagesCustomerAccount
'to' => 'nullable|string|max:1000',
'cc' => 'nullable|string|max:1000',
'bcc' => 'nullable|string|max:1000',
'with_layout' => 'nullable|boolean',
]);
$this->mailService->sendCustomEmail($uuid, $data, Auth::guard('admin')->user(), $request->ip());