<?php
/**
 * WELCOME EMAIL TEMPLATE
 * File: templates/email/welcome.php
 * Welcome email for new user registrations
 * 
 * Available variables: $first_name, $email, $user_type, $app_name, $app_url
 */

// Email content
ob_start();

// Get user type with default
$user_type = $user_type ?? 'customer';
$first_name = $first_name ?? 'there';
?>

<?php if ($user_type === 'customer'): ?>
    <p>Welcome to <?= $app_name ?>! We're excited to have you join our community of renters and explorers.</p>
    
    <p>As a customer, you now have access to:</p>
    
    <ul>
        <li><strong>Browse & Book:</strong> Discover thousands of items from trusted vendors</li>
        <li><strong>Secure Payments:</strong> Safe and secure payment processing</li>
        <li><strong>Customer Support:</strong> 24/7 support for all your rental needs</li>
        <!-- <li><strong>Insurance Coverage:</strong> Protection for your rentals</li> -->
        <!-- <li><strong>Mobile App:</strong> Manage your rentals on the go</li> -->
    </ul>
    
    <div class="order-summary">
        <h3>Get Started Today</h3>
        <p>Ready to start your rental journey? Here are some popular categories to explore:</p>
        <ul>
            <li>📸 <strong>Photography Equipment</strong> - Cameras, lenses, and lighting</li>
            <li>🔧 <strong>Tools & Equipment</strong> - Power tools and construction gear</li>
            <li>🎉 <strong>Party & Events</strong> - Sound systems, decorations, and more</li>
            <li>🚗 <strong>Vehicles</strong> - Cars, motorcycles, and transportation</li>
        </ul>
    </div>
    
<?php elseif ($user_type === 'vendor'): ?>
    <p>Welcome to <?= $app_name ?>! We're thrilled to have you as a vendor partner.</p>
    
    <p>As a vendor, you now have access to:</p>
    
    <ul>
        <li><strong>List Your Items:</strong> Upload and manage your rental inventory</li>
        <li><strong>Flexible Pricing:</strong> Set your own rates and availability</li>
        <li><strong>Secure Payments:</strong> Get paid safely and reliably</li>
        <li><strong>Analytics Dashboard:</strong> Track your earnings and performance</li>
        <li><strong>Marketing Support:</strong> We help promote your listings</li>
    </ul>
    
    <div class="order-summary">
        <h3>Start Earning Today</h3>
        <p>Ready to start earning? Here's how to list your first item:</p>
        <ol>
            <li>Go to your vendor dashboard</li>
            <li>Click "Add New Item"</li>
            <li>Upload clear photos and write a detailed description</li>
            <li>Set your price and availability</li>
            <li>Submit for approval</li>
        </ol>
        <p>Most items are approved within 24-48 hours!</p>
    </div>
    
    <div class="alert alert-info">
        <strong>Vendor Account Status:</strong> Your vendor account is currently pending approval. Our team will review your application and activate your account within 24-48 hours. You'll receive an email notification once approved.
    </div>
    
<?php endif; ?>

<div class="alert alert-success">
    <strong>✓ Email Verified:</strong> Your email address has been successfully verified and your account is now active!
</div>

<p>If you have any questions or need assistance getting started, our support team is here to help 24/7.</p>

<?php
$content = ob_get_clean();

// Prepare email data
$email_data = [
    'title' => 'Welcome to ' . $app_name . '!',
    'greeting' => "Hello " . $first_name . "!",
    'content' => $content,
    'action_url' => $app_url . '/' . ($user_type === 'vendor' ? 'vendor' : 'customer') . '/index.php',
    'action_text' => $user_type === 'vendor' ? 'Go to Vendor Dashboard' : 'Start Browsing Items',
    'footer_note' => 'Questions? Reply to this email or contact our support team.',
    'signature' => "Best regards,<br>The " . $app_name . " Team<br>support@rentidium.com"
];

// Include layout
include 'layout.php';
?>
