<?php

namespace App\Libraries;

class EmailTemplateDefaults
{
    public static function all(): array
    {
        return [
            "lead_notification" => [
                "template_key" => "lead_notification",
                "name" => "New lead notification",
                "description" =>
                    "Alerts the BrandSquare team when a new lead is captured.",
                "category" => "Internal",
                "subject" => "New logo enquiry from {{name}}",
                "preheader" =>
                    "A new {{source}} lead is waiting in your admin panel.",
                "heading" => "A new brand conversation has started.",
                "body" =>
                    "Name: {{name}}\nEmail: {{email}}\nMobile: {{phone}}\nBusiness: {{business_name}}\nIndustry: {{industry}}\nStyle: {{style}}\nBudget: {{budget}}\n\nMessage:\n{{message}}",
                "cta_label" => "Open leads dashboard",
                "cta_url" => "{{admin_leads_url}}",
                "accent_color" => "#caff62",
                "enabled" => 1,
                "variables" => [
                    "name",
                    "email",
                    "phone",
                    "business_name",
                    "industry",
                    "style",
                    "budget",
                    "message",
                    "source",
                    "admin_leads_url",
                ],
            ],
            "enquiry_submitted" => [
                "template_key" => "enquiry_submitted",
                "name" => "Enquiry submitted",
                "description" =>
                    "Confirmation sent after the short navigation enquiry form.",
                "category" => "Lead confirmation",
                "subject" => "We received your enquiry, {{name}}",
                "preheader" =>
                    "Your BrandSquare logo enquiry is safely with our team.",
                "heading" => "Your next great logo starts here.",
                "body" =>
                    "Hi {{name}},\n\nThank you for reaching out to BrandSquare. We’ve received your enquiry and a brand specialist will contact you within one business day.\n\nWe’ll keep the conversation clear, useful, and focused on what your business needs.",
                "cta_label" => "Explore our selected work",
                "cta_url" => "{{site_url}}#work",
                "accent_color" => "#ff6846",
                "enabled" => 1,
                "variables" => ["name", "email", "phone", "site_url"],
            ],
            "logo_brief_submitted" => [
                "template_key" => "logo_brief_submitted",
                "name" => "Logo brief submitted",
                "description" =>
                    "Confirmation sent after the complete logo brief.",
                "category" => "Lead confirmation",
                "subject" => "Your logo brief is in, {{name}}",
                "preheader" =>
                    "We’re reviewing the ideas you shared for {{business_name}}.",
                "heading" => "Brief received. Ideas are already moving.",
                "body" =>
                    "Hi {{name}},\n\nThank you for sharing the vision for {{business_name}}. We’ve received your logo brief and will review your {{style}} direction, industry, and goals carefully.\n\nExpect a personal response within one business day with clear next steps, timing, and pricing.",
                "cta_label" => "See how our process works",
                "cta_url" => "{{site_url}}#process",
                "accent_color" => "#ff6846",
                "enabled" => 1,
                "variables" => [
                    "name",
                    "business_name",
                    "industry",
                    "style",
                    "budget",
                    "site_url",
                ],
            ],
            "quotation_attached" => [
                "template_key" => "quotation_attached",
                "name" => "Quotation attached",
                "description" =>
                    "Accompanies a logo-design quotation attachment.",
                "category" => "Sales document",
                "subject" => "Your BrandSquare quotation {{quotation_number}}",
                "preheader" =>
                    "A tailored quotation for {{business_name}} is attached.",
                "heading" => "A clear plan for a memorable brand.",
                "body" =>
                    "Hi {{name}},\n\nAttached is quotation {{quotation_number}} for {{business_name}}. It outlines the recommended logo-design scope, deliverables, timeline, and investment of {{amount}}.\n\nPlease reply with any questions. We’re happy to make every detail clear before the project begins.",
                "cta_label" => "Discuss your quotation",
                "cta_url" => "{{whatsapp_url}}",
                "accent_color" => "#3155ed",
                "enabled" => 1,
                "variables" => [
                    "name",
                    "business_name",
                    "quotation_number",
                    "amount",
                    "attachment_name",
                    "whatsapp_url",
                ],
            ],
            "quotation_email" => [
                "template_key" => "quotation_email",
                "name" => "Quotation email",
                "description" =>
                    "Sends quotation details in the email without a PDF attachment.",
                "category" => "Sales document",
                "subject" => "Quotation {{quotation_number}} from BrandSquare",
                "preheader" =>
                    "Your tailored quotation for {{business_name}} is ready.",
                "heading" => "A clear plan for a memorable brand.",
                "body" =>
                    "Hi {{name}},\n\nWe’ve prepared quotation {{quotation_number}} for {{business_name}}.\n\nQuotation summary:\n{{items_summary}}\n\nTotal investment: {{amount}}\nValid until: {{valid_until}}\n\nReply to this email or message us if you’d like to discuss the scope, timing, or next steps.\n\nWe’re excited about the possibility of creating this brand with you.",
                "cta_label" => "Discuss your quotation",
                "cta_url" => "{{whatsapp_url}}",
                "accent_color" => "#3155ed",
                "enabled" => 1,
                "variables" => [
                    "name",
                    "business_name",
                    "quotation_number",
                    "items_summary",
                    "amount",
                    "valid_until",
                    "whatsapp_url",
                ],
            ],
            "invoice_attached" => [
                "template_key" => "invoice_attached",
                "name" => "Invoice attached",
                "description" =>
                    "Accompanies an invoice attachment sent to a client.",
                "category" => "Accounts",
                "subject" => "Invoice {{invoice_number}} from BrandSquare",
                "preheader" =>
                    "Invoice {{invoice_number}} for {{amount}} is attached.",
                "heading" => "Thank you for building your brand with us.",
                "body" =>
                    "Hi {{name}},\n\nPlease find invoice {{invoice_number}} for {{business_name}} attached. The total is {{amount}}, due by {{due_date}}.\n\nIf you need a correction or have a payment question, simply reply to this email and our team will help.",
                "cta_label" => "Contact accounts",
                "cta_url" => "mailto:{{from_email}}",
                "accent_color" => "#2f8f63",
                "enabled" => 1,
                "variables" => [
                    "name",
                    "business_name",
                    "invoice_number",
                    "amount",
                    "due_date",
                    "attachment_name",
                    "from_email",
                ],
            ],
            "invoice_email" => [
                "template_key" => "invoice_email",
                "name" => "Invoice email",
                "description" =>
                    "Sends invoice details in the email without a PDF attachment.",
                "category" => "Accounts",
                "subject" => "Invoice {{invoice_number}} from BrandSquare",
                "preheader" =>
                    "Invoice {{invoice_number}} for {{amount}} is ready.",
                "heading" => "Thank you for building your brand with us.",
                "body" =>
                    "Hi {{name}},\n\nHere are the details for invoice {{invoice_number}} for {{business_name}}.\n\nInvoice summary:\n{{items_summary}}\n\nTotal due: {{amount}}\nPayment due: {{due_date}}\n\nIf you need a correction or have a payment question, simply reply to this email and our team will help.",
                "cta_label" => "Contact accounts",
                "cta_url" => "mailto:{{from_email}}",
                "accent_color" => "#2f8f63",
                "enabled" => 1,
                "variables" => [
                    "name",
                    "business_name",
                    "invoice_number",
                    "items_summary",
                    "amount",
                    "due_date",
                    "from_email",
                ],
            ],
        ];
    }

    public static function get(string $key): ?array
    {
        $templates = self::all();
        return $templates[$key] ?? null;
    }
}
