<?php
/**
 * VENDOR ITEM APPROVED EMAIL TEMPLATE
 * File: templates/email/item-approved.php
 *
 * Variables available via Mailer::getTemplate() extract():
 *   $vendor_name  - vendor business name
 *   $item_title   - item title
 *   $app_name     - platform name (APP_NAME)
 *   $app_url      - platform URL  (APP_URL)
 */

ob_start();
?>

<div class="alert alert-success">
    <strong>🎉 Your Item Listing Has Been Approved!</strong><br>
    Your item is now live on the platform and available for customer bookings.
</div>

<div class="order-summary">
    <h3>Item Details</h3>
    <p><strong>Item Name:</strong> <?= htmlspecialchars($item_title) ?></p>
    <p><strong>Status:</strong> <span style="color: #28a745; font-weight: bold;">Approved &amp; Live</span></p>
</div>

<p>
    Our admin team has reviewed your listing and it has been <strong>approved</strong>.
    Customers can now find, view, and book your item on the platform.
</p>

<div class="alert alert-info">
    <strong>What happens next?</strong>
    <ul style="margin: 10px 0 0 20px;">
        <li>Your item is now searchable and bookable by customers.</li>
        <li>You will receive an email notification whenever a customer places an order.</li>
        <li>Earnings from completed rentals will be credited to your wallet.</li>
        <li>You can update item details from your vendor dashboard at any time — changes will require re-approval.</li>
    </ul>
</div>

<div class="alert alert-warning">
    <strong>Tips to get more bookings:</strong>
    <ul style="margin: 10px 0 0 20px;">
        <li>Add high-quality photos from multiple angles.</li>
        <li>Keep your availability calendar up to date.</li>
        <li>Respond promptly to customer enquiries.</li>
        <li>Encourage customers to leave reviews after each completed rental.</li>
    </ul>
</div>

<p>Thank you for listing on <?= APP_NAME ?>. We look forward to helping you earn from your assets!</p>

<?php
$content = ob_get_clean();

$email_data = [
    'title'                 => 'Item Approved — ' . htmlspecialchars($item_title),
    'greeting'              => 'Hello ' . htmlspecialchars($vendor_name) . '!',
    'content'               => $content,
    'action_url'            => APP_URL . '/vendor/items.php',
    'action_text'           => 'View My Items',
    'secondary_action_url'  => APP_URL . '/vendor/dashboard.php',
    'secondary_action_text' => 'Go to Dashboard',
    'footer_note'           => 'If you have any questions, please contact our support team.',
    'signature'             => "Best regards,<br>The " . APP_NAME . " Team",
];

extract($email_data);
include 'layout.php';
?>