Files
portal-api/database/seeders/EmailTemplates/BillingTemplates.php

173 lines
14 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace Database\Seeders\EmailTemplates;
use App\Support\EmailTemplateShell as T;
final class BillingTemplates
{
/**
* @return array<int, array{scenario: string, name: string, subject: string, body: string, types?: array<string, string>}>
*/
public static function all(): array
{
return [
[
'scenario' => 'invoice_notification',
'name' => 'Thông báo hoá đơn / gia hạn cước',
'subject' => '{{title}} #{{invoice_number}} - {{company_name}}',
'body' => T::title('{{title}}')
. T::greeting('{{customer_name}}')
. T::paragraph('{{body_message}}')
. T::infoTable([
'Số hoá đơn' => '{{invoice_number}}',
'Ngày lập' => '{{created_date}}',
'Hạn thanh toán' => '{{due_date}}',
'Tổng tiền' => '{{total}} VNĐ',
'Trạng thái' => '{{status_label}}',
], '{{outstanding_row}}{{lookup_row}}')
. T::paragraph('{{intro_note}}')
. '{{lookup_note}}'
. '{{pay_button}}{{attachments_block}}{{note_block}}'
. T::supportLine(),
],
[
'scenario' => 'invoice_payment_reminder',
'name' => 'Nhắc thanh toán hoá đơn',
'subject' => 'Nhắc thanh toán hoá đơn {{invoice_number}}',
'body' => T::title('Nhắc thanh toán hoá đơn')
. T::greeting('{{client_name}}')
. T::paragraph('{{status_line}} Vui lòng thanh toán để dịch vụ không bị gián đoạn.')
. T::infoTable([
'Số hoá đơn' => '{{invoice_number}}',
'Hạn thanh toán' => '{{due_date}}',
'Tổng tiền' => '{{total}} VNĐ',
], '{{paid_row}}' . T::row('Còn phải thanh toán', '<span style="color: #dc2626;">{{outstanding}} VNĐ</span>') . '{{lookup_row}}')
. '{{lookup_note}}'
. T::button('{{login_url}}', 'THANH TOÁN NGAY')
. T::paragraph('Nếu Quý khách đã thanh toán, vui lòng bỏ qua email này.')
. T::supportLine(),
],
[
'scenario' => 'customer_deposit_success',
'name' => 'Nạp tiền thành công',
'subject' => 'Thông báo nạp tiền thành công - {{amount_formatted}} VNĐ',
'body' => T::title('Nạp tiền thành công')
. T::greeting('{{customer_name}}')
. T::paragraph('Tài khoản của Quý khách đã được nạp tiền thành công. Chi tiết giao dịch:')
. T::infoTable([
'Mã giao dịch' => '{{transaction_code}}',
'Số tiền nạp' => '<span style="color: #16a34a;">{{amount_formatted}} VNĐ</span>',
'Tiền khuyến mãi' => '{{credit_formatted}} VNĐ',
'Thời gian' => '{{deposit_date}}',
'Số dư hiện tại' => '{{current_total_formatted}} VNĐ',
'Số dư khuyến mãi' => '{{current_credit_formatted}} VNĐ',
])
. T::button('{{login_url}}', 'XEM TÀI KHOẢN')
. T::supportLine(),
],
[
'scenario' => 'manual_deposit_status',
'name' => 'Trạng thái nạp tiền thủ công',
'subject' => '{{company_name}} - Trạng thái nạp tiền',
'types' => ['status_label' => 'string'],
'body' => T::title('Cập nhật yêu cầu nạp tiền')
. T::greeting('{{customer_name}}')
. T::paragraph('{{status_message}}')
. T::infoTable([
'Trạng thái' => '<span style="display: inline-block; border-radius: 20px; padding: 2px 12px; background-color: {{status_bg}}; color: {{status_color}};">{{status_label}}</span>',
'Mã giao dịch' => '{{transaction_code}}',
'Số tiền' => '{{amount_formatted}} VNĐ',
'Thời gian gửi' => '{{deposit_date}}',
], '{{processed_date_row}}')
. T::button('{{portal_url}}', 'XEM YÊU CẦU NẠP TIỀN')
. T::supportLine(),
],
[
'scenario' => 'order_created',
'name' => 'Xác nhận đơn hàng',
'subject' => 'Xác nhận đơn hàng #{{order_num}}',
'body' => T::title('Xác nhận đơn hàng')
. T::greeting('{{client_name}}')
. T::paragraph('Cảm ơn Quý khách đã đặt hàng tại <strong>{{company_name}}</strong>! Đơn hàng đã được tiếp nhận thành công.')
. T::infoTable([
'Mã đơn hàng' => '{{order_num}}',
'Mã hoá đơn' => '{{invoice_num}}',
'Tổng tiền' => '{{order_total}} VNĐ',
])
. T::paragraph('Chúng tôi sẽ xử lý đơn hàng trong thời gian sớm nhất và thông báo cho Quý khách khi dịch vụ được kích hoạt.')
. T::supportLine()
. T::autoNotice(),
],
[
'scenario' => 'domain_order_received',
'name' => 'Đơn đăng ký tên miền đã ghi nhận',
'subject' => 'Đơn đăng ký tên miền {{domain_name}} đã được ghi nhận',
'body' => T::title('Đã ghi nhận đơn đăng ký tên miền')
. T::greeting('{{customer_name}}')
. T::paragraph('Cảm ơn Quý khách đã đặt mua tên miền tại <strong>{{company_name}}</strong>. Đơn hàng đang chờ đội ngũ kỹ thuật kiểm tra và đăng ký.')
. T::infoTable([
'Tên miền' => '{{domain_name}}',
'Mã đơn hàng' => '{{order_num}}',
'Tổng tiền' => '{{order_total}}',
'Thời gian' => '{{created_at}}',
])
. T::note('Việc đặt mua chưa đồng nghĩa tên miền đã được đăng ký thành công. Nếu tên miền không còn khả dụng, số tiền đã thanh toán sẽ được hoàn lại vào tài khoản.')
. T::button('{{order_url}}', 'XEM ĐƠN HÀNG')
. T::supportLine(),
],
[
'scenario' => 'domain_order_approved',
'name' => 'Bàn giao tên miền',
'subject' => 'Bàn giao tên miền {{domain_name}} - {{company_name}}',
'body' => self::domainOrderApprovedBody(),
],
[
'scenario' => 'domain_order_rejected',
'name' => 'Tên miền bị từ chối',
'subject' => 'Tên miền {{domain_name}} đã bị từ chối đăng ký',
'body' => T::title('Tên miền bị từ chối đăng ký')
. T::greeting('{{client_name}}')
. T::paragraph('Rất tiếc, đơn đăng ký tên miền của Quý khách đã bị <strong style="color: #dc2626;">từ chối</strong>.')
. T::infoTable([
'Tên miền' => '{{domain_name}}',
'Mã đơn hàng' => '{{order_num}}',
'Lý do' => '{{reason}}',
])
. T::paragraph('Số tiền đã thanh toán sẽ được hoàn lại vào tài khoản của Quý khách.')
. T::supportLine()
. T::autoNotice(),
],
];
}
private static function domainOrderApprovedBody(): string
{
return <<<'HTML'
<p style="font-size:15px;color:#1f2937;margin:0 0 8px">Kính gửi Quý Khách <strong>{{client_name}}</strong>,</p>
<p style="font-size:14px;color:#1a1a1a;line-height:1.6;margin:0 0 24px">Công ty Cổ phần Giải pháp Công nghệ Thế Giới Số xin chân thành cảm ơn Quý Khách đã tin tưởng lựa chọn dịch vụ đăng ký và quản lý tên miền của chúng tôi.</p>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin-bottom:12px"><tbody><tr><td style="font-size:15px;font-weight:bold;color:#f97316;padding-bottom:10px;border-bottom:2px solid #fed7aa">🌐 I. THÔNG TIN TÊN MIỀN</td></tr></tbody></table>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #f6d2b8;border-radius:10px;border-collapse:separate;overflow:hidden;margin-bottom:24px;font-size:12.5px"><tbody>
<tr><td style="padding:11px 14px;color:#c2410c;font-size:13px;font-weight:bold;letter-spacing:.4px;border-bottom:1px solid #f6d2b8;background:#fff5ee;text-align:center">Tên miền</td><td style="padding:11px 14px;color:#c2410c;font-size:13px;font-weight:bold;letter-spacing:.4px;border-bottom:1px solid #f6d2b8;background:#fff5ee;text-align:center">Ngày đăng ký</td><td style="padding:11px 14px;color:#c2410c;font-size:13px;font-weight:bold;letter-spacing:.4px;border-bottom:1px solid #f6d2b8;background:#fff5ee;text-align:center">Ngày hết hạn</td><td style="padding:11px 14px;color:#c2410c;font-size:13px;font-weight:bold;letter-spacing:.4px;border-bottom:1px solid #f6d2b8;background:#fff5ee;text-align:center">NS1</td><td style="padding:11px 14px;color:#c2410c;font-size:13px;font-weight:bold;letter-spacing:.4px;border-bottom:1px solid #f6d2b8;background:#fff5ee;text-align:center">NS2</td></tr>
<tr><td style="padding:11px 10px;color:#111827;font-weight:bold;text-align:center">{{domain_name}}</td><td style="padding:11px 10px;color:#111827;text-align:center">{{registered_at}}</td><td style="padding:11px 10px;color:#c2410c;font-weight:bold;text-align:center">{{expires_at}}</td><td style="padding:11px 10px;color:#111827;text-align:center">{{name_server_1}}</td><td style="padding:11px 10px;color:#111827;text-align:center">{{name_server_2}}</td></tr>
</tbody></table>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin-bottom:12px"><tbody><tr><td style="font-size:15px;font-weight:bold;color:#f97316;padding-bottom:10px;border-bottom:2px solid #fed7aa">🔐 II. THÔNG TIN TÀI KHOẢN QUẢN LÝ</td></tr></tbody></table>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#eff6ff;border:1px solid #bfdbfe;border-radius:6px;margin-bottom:12px"><tbody><tr><td style="padding:16px"><p style="margin:0 0 8px;font-size:13px;color:#374151">🔗 <strong>Trang đăng nhập:</strong> <a href="{{login_url}}" style="color:#c2410c" target="_blank" rel="noopener">{{login_url}}</a></p><p style="margin:0 0 8px;font-size:13px;color:#374151">👤 <strong>Tên đăng nhập:</strong> {{customer_email}}</p><p style="margin:0;font-size:13px;color:#374151">🔑 <strong>Mật khẩu:</strong> Mật khẩu tài khoản portal của Quý Khách</p></td></tr></tbody></table>
<p style="font-size:12.5px;color:#065f46;background:#ecfdf5;border-left:3px solid #6ee7b7;padding:10px 14px;margin:0 0 24px;border-radius:4px">🔒 Quý Khách vui lòng đổi mật khẩu ngay sau lần đăng nhập đầu tiên và bảo mật thông tin tài khoản.</p>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin-bottom:12px"><tbody><tr><td style="font-size:15px;font-weight:bold;color:#f97316;padding-bottom:10px;border-bottom:2px solid #fed7aa">📋 III. LƯU Ý QUAN TRỌNG – XÁC THỰC TÊN MIỀN</td></tr></tbody></table>
<p style="font-size:13.5px;color:#1a1a1a;line-height:1.7;margin:0 0 16px">Quý Khách cần hoàn tất thủ tục xác thực tên miền theo hướng dẫn để tránh tình trạng gián đoạn dịch vụ do chưa hoàn tất xác thực.</p>
{{kyc_block}}
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#ecfdf5;border:1px solid #a7f3d0;border-radius:6px;margin:0 0 24px"><tbody><tr><td style="padding:16px"><p style="margin:0 0 8px;font-size:13px;color:#065f46;font-weight:bold">📮 Bản gốc vui lòng gửi về:</p><p style="margin:0 0 4px;font-size:13px;color:#374151">CÔNG TY CỔ PHẦN GIẢI PHÁP CÔNG NGHỆ THẾ GIỚI SỐ</p><p style="margin:0 0 4px;font-size:13px;color:#374151">128/38 Tân Hương, Phường Phú Thọ Hòa, TP. Hồ Chí Minh</p><p style="margin:0;font-size:13px;color:#374151">Người nhận: Ms. Vân Anh – 0818 006 119 (P. HCNS)</p></td></tr></tbody></table>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="margin-bottom:12px"><tbody><tr><td style="font-size:15px;font-weight:bold;color:#f97316;padding-bottom:10px;border-bottom:2px solid #fed7aa">📞 IV. HỖ TRỢ KỸ THUẬT 24/7</td></tr></tbody></table>
<p style="font-size:13.5px;color:#374151;margin:0 0 4px">☎ <strong>Hotline:</strong> (028) 7309 7379</p>
<p style="font-size:13.5px;color:#374151;margin:0 0 24px">✉ <strong>Email:</strong> <a href="mailto:support@tgs.com.vn" style="color:#c2410c">support@tgs.com.vn</a></p>
<p style="font-size:14px;color:#1a1a1a;line-height:1.6;margin:0">Một lần nữa, Thế Giới Số xin chân thành cảm ơn sự tin tưởng và đồng hành của Quý Khách. Chúng tôi luôn sẵn sàng hỗ trợ để đảm bảo trải nghiệm dịch vụ tốt nhất.</p>
HTML;
}
}